becky_cli/becky/providers/remote_provider.py
def _get_remote_checksums(self, remote_paths):
        """
        Runs checksums on the remote server on the given paths.
        Process:
            1. Copies the list of files to run checksum to the server.
            2. Runs md5sum on each file on the remote server and save results to tmp.
            3. Copy back the results.
        TODO: Maybe use an actual SSH client to do this without any file saving.
        """
        remote_addr = self._get_parameter('remote_addr')
        remote_copy_path = self._get_parameter('remote_path')
        ssh_identity_path = self._get_parameter('ssh_id_path')

        remote_paths_file = '/tmp/{}'.format(str(uuid.uuid4()))
        remote_checksums_file = '/tmp/{}'.format(str(uuid.uuid4()))
        open(remote_paths_file, "w").write('\n'.join(remote_paths) + '\n')
        command = 'scp -i {} {} {}:{} > /dev/null'.format(ssh_identity_path, remote_paths_file, remote_addr, remote_paths_file)
        os.system(command)
        command = "ssh -i {} {} 'while read line; do md5sum $line; done < {} > {} 2>/dev/null' > /dev/null".format(ssh_identity_path, remote_addr, remote_paths_file, remote_checksums_file)
        os.system(command)
        command = 'scp -i {} {}:{} {} > /dev/null'.format(ssh_identity_path, remote_addr, remote_checksums_file, remote_checksums_file)
        os.system(command)
        checksum_lines = open(remote_checksums_file, "r").read().split('\n')
        checksums = {}
        checksum_lines = [l.strip() for l in checksum_lines if l.strip()]
        for checksum_i, checksum_line in enumerate(checksum_lines):
            checksum = checksum_line.split(" ")[0].strip()
            file_name = checksum_line.split(" ", 1)[1].strip()
            checksums[file_name] = checksum
        return checksums

        Runs checksums on the remote server on the given paths.
        Process:
            1. Copies the list of files to run checksum to the server.
            2. Runs md5sum on each file on the remote server and save results to tmp.
            3. Copy back the results.
        TODO: Maybe use an actual SSH client to do this without any file saving.
        
Runs checksums on the remote server on the given paths.
Process:
1. Copies the list of files to run checksum to the server.
2. Runs md5sum on each file on the remote server and save results to tmp.
3. Copy back the results.
TODO: Maybe use an actual SSH client to do this without any file saving.
Runs checksums on the remote server on the given paths . Process : 1 . Copies the list of files to run checksum to the server . 2 . Runs md5sum on each file on the remote server and save results to tmp . 3 . Copy back the results . TODO : Maybe use an actual SSH client to do this without any file saving .
def _get_remote_checksums(self, remote_paths):
        remote_addr = self._get_parameter('remote_addr')
        remote_copy_path = self._get_parameter('remote_path')
        ssh_identity_path = self._get_parameter('ssh_id_path')
        remote_paths_file = '/tmp/{}'.format(str(uuid.uuid4()))
        remote_checksums_file = '/tmp/{}'.format(str(uuid.uuid4()))
        open(remote_paths_file, "w").write('\n'.join(remote_paths) + '\n')
        command = 'scp -i {} {} {}:{} > /dev/null'.format(ssh_identity_path, remote_paths_file, remote_addr, remote_paths_file)
        os.system(command)
        command = "ssh -i {} {} 'while read line; do md5sum $line; done < {} > {} 2>/dev/null' > /dev/null".format(ssh_identity_path, remote_addr, remote_paths_file, remote_checksums_file)
        os.system(command)
        command = 'scp -i {} {}:{} {} > /dev/null'.format(ssh_identity_path, remote_addr, remote_checksums_file, remote_checksums_file)
        os.system(command)
        checksum_lines = open(remote_checksums_file, "r").read().split('\n')
        checksums = {}
        checksum_lines = [l.strip() for l in checksum_lines if l.strip()]
        for checksum_i, checksum_line in enumerate(checksum_lines):
            checksum = checksum_line.split(" ")[0].strip()
            file_name = checksum_line.split(" ", 1)[1].strip()
            checksums[file_name] = checksum
        return checksums
def _get_remote_checksums ( self , remote_paths ) : remote_addr = self . _get_parameter ( 'remote_addr' ) remote_copy_path = self . _get_parameter ( 'remote_path' ) ssh_identity_path = self . _get_parameter ( 'ssh_id_path' ) remote_paths_file = '/tmp/{}' . format ( str ( uuid . uuid4 ( ) ) ) remote_checksums_file = '/tmp/{}' . format ( str ( uuid . uuid4 ( ) ) ) open ( remote_paths_file , "w" ) . write ( '\n' . join ( remote_paths ) + '\n' ) command = 'scp -i {} {} {}:{} > /dev/null' . format ( ssh_identity_path , remote_paths_file , remote_addr , remote_paths_file ) os . system ( command ) command = "ssh -i {} {} 'while read line; do md5sum $line; done < {} > {} 2>/dev/null' > /dev/null" . format ( ssh_identity_path , remote_addr , remote_paths_file , remote_checksums_file ) os . system ( command ) command = 'scp -i {} {}:{} {} > /dev/null' . format ( ssh_identity_path , remote_addr , remote_checksums_file , remote_checksums_file ) os . system ( command ) checksum_lines = open ( remote_checksums_file , "r" ) . read ( ) . split ( '\n' ) checksums = { } checksum_lines = [ l . strip ( ) for l in checksum_lines if l . strip ( ) ] for checksum_i , checksum_line in enumerate ( checksum_lines ) : checksum = checksum_line . split ( " " ) [ 0 ] . strip ( ) file_name = checksum_line . split ( " " , 1 ) [ 1 ] . strip ( ) checksums [ file_name ] = checksum return checksums
Runs checksums on the remote server on the given paths.
Runs checksums on the remote server on the given paths .
"""
        Runs checksums on the remote server on the given paths.
        Process:
            1. Copies the list of files to run checksum to the server.
            2. Runs md5sum on each file on the remote server and save results to tmp.
            3. Copy back the results.
        TODO: Maybe use an actual SSH client to do this without any file saving.
        """
self
remote_paths