def scp_between_remotes(src, dst, port, s_passwd, d_passwd, s_name, d_name, s_path, d_path, limit='', log_filename=None, timeout=600, src_inter=None, dst_inter=None):
 if limit:
  limit = ('-l %s' % limit)
 if (src and src.lower().startswith('fe80')):
  if (not src_inter):
   raise SCPError('When using ipv6 linklocal address must assign ', 'the interface the neighbour attache')
  src = ('%s%%%s' % (src, src_inter))
 if (dst and dst.lower().startswith('fe80')):
  if (not dst_inter):
   raise SCPError('When using ipv6 linklocal address must assign ', 'the interface the neighbour attache')
  dst = ('%s%%%s' % (dst, dst_inter))
 command = ('scp -v -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=password -r %s -P %s %s@\\[%s\\]:%s %s@\\[%s\\]:%s' % (limit, port, s_name, src, s_path, d_name, dst, d_path))
 password_list = []
 password_list.append(s_passwd)
 password_list.append(d_passwd)
 return remote_scp(command, password_list, log_filename, timeout)

def scp_between_remotes ( src , dst , port , s_passwd , d_passwd , s_name , d_name , s_path , d_path , limit = '' , log_filename = None , timeout = 600 , src_inter = None , dst_inter = None ) : if limit : limit = ( '-l %s' % limit ) if ( src and src . lower ( ) . startswith ( 'fe80' ) ) : if ( not src_inter ) : raise SCPError ( 'When using ipv6 linklocal address must assign ' , 'the interface the neighbour attache' ) src = ( '%s%%%s' % ( src , src_inter ) ) if ( dst and dst . lower ( ) . startswith ( 'fe80' ) ) : if ( not dst_inter ) : raise SCPError ( 'When using ipv6 linklocal address must assign ' , 'the interface the neighbour attache' ) dst = ( '%s%%%s' % ( dst , dst_inter ) ) command = ( 'scp -v -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=password -r %s -P %s %s@\\[%s\\]:%s %s@\\[%s\\]:%s' % ( limit , port , s_name , src , s_path , d_name , dst , d_path ) ) password_list = [ ] password_list . append ( s_passwd ) password_list . append ( d_passwd ) return remote_scp ( command , password_list , log_filename , timeout )
copy files from a remote host to another remote host .