From d4d0950d7157720c719aa4cceac69b36df20edee Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Tue, 5 Jun 2012 16:08:11 +0530 Subject: [PATCH] Adding support for file copy to marvin's remoteSSHClient Signed-off-by: Prasanna Santhanam --- tools/marvin/marvin/remoteSSHClient.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index 8836844dc9f..4063b33fc72 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -52,7 +52,16 @@ class remoteSSHClient(object): results.append(strOut.rstrip()) return results - + + def scp(self, srcFile, destPath): + transport = paramiko.Transport((self.host, int(self.port))) + transport.connect(username = self.user, password=self.passwd) + sftp = paramiko.SFTPClient.from_transport(transport) + try: + sftp.put(srcFile, destPath) + except IOError, e: + raise e + if __name__ == "__main__": ssh = remoteSSHClient("192.168.137.2", 22, "root", "password")