[dts] [DTS][PATCH V2 2/4] virt: add copy file from virt guest

Jingguo Fu jingguox.fu at intel.com
Fri Jan 8 09:12:44 CET 2016


Signed-off-by: Jingguo Fu <jingguox.fu at intel.com>
---
 framework/ssh_pexpect.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index 046692f..96c4409 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -141,6 +141,9 @@ class SSHPexpect(object):
         Copies a file from a remote place into local.
         """
         command = 'scp {0}@{1}:{2} {3}'.format(self.username, self.host, src, dst)
+        if ':' in self.host:
+            command = 'scp -P {0} -o NoHostAuthenticationForLocalhost=yes {1}@{2}:{3} {4}'.format(
+                str(self.port), self.username, self.ip, src, dst)
         if password == '':
             self._spawn_scp(command, self.password)
         else:
-- 
2.1.0



More information about the dts mailing list