#NEWLINE# def transfer( self , data ) : #NEWLINE# #INDENT# host_src = data [ 'host_src' ] #NEWLINE# path_src = data [ 'path_src' ] #NEWLINE# host_dst = data [ 'host_dst' ] #NEWLINE# path_dst = data [ 'path_dst' ] #NEWLINE# cmd = '{bbcp} {options} {src} {dst} 2>&1' #NEWLINE# options = CONF . bbcp . options #NEWLINE# additional_options = [ ] #NEWLINE# forced_options = [ '-f' , '-p' ] #NEWLINE# if CONF . migrate . copy_with_md5_verification : #NEWLINE# #INDENT# forced_options . append ( '-e' ) #NEWLINE# #UNINDENT# for o in forced_options : #NEWLINE# #INDENT# if ( o not in options ) : #NEWLINE# #INDENT# additional_options . append ( o ) #NEWLINE# #UNINDENT# #UNINDENT# run_options = [ '-T' ] #NEWLINE# if CONF . migrate . direct_transfer : #NEWLINE# #INDENT# src = path_src #NEWLINE# bbcp = BBCP_PATH #NEWLINE# runner = self . runner ( host_src , 'src' , data . get ( 'gateway' ) ) #NEWLINE# run = runner . run #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# run_options += [ '-S' ] #NEWLINE# src = '{user_src}@{host_src}:{path_src}' . format ( user_src = CONF . src . ssh_user , host_src = host_src , path_src = path_src ) #NEWLINE# bbcp = CONF . bbcp . path #NEWLINE# run = local . run #NEWLINE# #UNINDENT# dst = '{user_dst}@{host_dst}:{path_dst}' . format ( user_dst = CONF . dst . ssh_user , host_dst = host_dst , path_dst = path_dst ) #NEWLINE# for o in run_options : #NEWLINE# #INDENT# if ( o not in options ) : #NEWLINE# #INDENT# additional_options . append ( ( o + " '{remote_bbcp}'" ) ) #NEWLINE# #UNINDENT# #UNINDENT# remote_bbcp = 'ssh {ssh_opts} %I -l %U %H {path}' . format ( ssh_opts = ssh_util . default_ssh_options ( ) , path = BBCP_PATH ) #NEWLINE# options += ( ' ' + ' ' . join ( additional_options ) . format ( remote_bbcp = remote_bbcp ) ) #NEWLINE# retrier = retrying . Retry ( max_attempts = CONF . migrate . retry , timeout = 0 ) #NEWLINE# try : #NEWLINE# #INDENT# retrier . run ( run , cmd . format ( bbcp = bbcp , options = options , src = src , dst = dst ) , capture_output = False ) #NEWLINE# #UNINDENT# except retrying . MaxAttemptsReached : #NEWLINE# #INDENT# self . clean_dst ( host_dst , path_dst ) #NEWLINE# raise base . FileCopyError ( ** data )