def copy_files_to(address, client, username, password, port, local_path, remote_path, limit="", log_filename=None, verbose=False, timeout=600, interface=None): """ Copy files to a remote host (guest) using the selected client. :param client: Type of transfer client :param username: Username (if required) :param password: Password (if requried) :param local_path: Path on the local machine where we are copying from :param remote_path: Path on the remote machine where we are copying to :param address: Address of remote host(guest) :param limit: Speed limit of file transfer. :param log_filename: If specified, log all output to this file (SCP only) :param verbose: If True, log some stats using logging.debug (RSS only) :param timeout: The time duration (in seconds) to wait for the transfer to complete. :interface: The interface the neighbours attach to (only use when using ipv6 linklocal address.) :raise: Whatever remote_scp() raises """ if client == "scp": scp_to_remote(address, port, username, password, local_path, remote_path, limit, log_filename, timeout, interface=interface) elif client == "rss": log_func = None if verbose: log_func = logging.debug c = rss_client.FileUploadClient(address, port, log_func) c.upload(local_path, remote_path, timeout) c.close() else: raise error.TestError("No such file copy client: '%s', valid values" "are scp and rss" % client)
def copy_files_to(address, client, username, password, port, local_path, remote_path, limit="", log_filename=None, verbose=False, timeout=600): """ Copy files to a remote host (guest) using the selected client. @param client: Type of transfer client @param username: Username (if required) @param password: Password (if requried) @param local_path: Path on the local machine where we are copying from @param remote_path: Path on the remote machine where we are copying to @param address: Address of remote host(guest) @param limit: Speed limit of file transfer. @param log_filename: If specified, log all output to this file (SCP only) @param verbose: If True, log some stats using logging.debug (RSS only) @param timeout: The time duration (in seconds) to wait for the transfer to complete. @raise: Whatever remote_scp() raises """ if client == "scp": scp_to_remote(address, port, username, password, local_path, remote_path, limit, log_filename, timeout) elif client == "rss": log_func = None if verbose: log_func = logging.debug c = rss_client.FileUploadClient(address, port, log_func) c.upload(local_path, remote_path, timeout) c.close()