X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yardstick%2Fssh.py;h=339f834b7530f118a06a1f6bb5417366a520df7f;hb=a33f57371c740e0ab749bfffa4d31c08ef5c5b74;hp=253fd2e3da1b030cd57ce2c6ca05564786dfd4d8;hpb=4f4edd840823ff6a0151e3f5220241183e27e560;p=yardstick.git diff --git a/yardstick/ssh.py b/yardstick/ssh.py index 253fd2e3d..339f834b7 100644 --- a/yardstick/ssh.py +++ b/yardstick/ssh.py @@ -63,6 +63,7 @@ import socket import time import paramiko +from scp import SCPClient import six import logging @@ -254,3 +255,9 @@ class SSH(object): time.sleep(interval) if time.time() > (start_time + timeout): raise SSHTimeout("Timeout waiting for '%s'" % self.host) + + def put(self, files, remote_path=b'.', recursive=False): + client = self._get_client() + + with SCPClient(client.get_transport()) as scp: + scp.put(files, remote_path, recursive)