Patchwork [v2] lib/oeqa: sshcontrol: Allow alternate port for SSHControl

login
register
mail settings
Submitter Sipke Vriend
Date Jan. 27, 2014, 10:25 p.m.
Message ID <7d308450-d9cc-4489-96e8-3e000d5b4818@AM1EHSMHS013.ehs.local>
Download mbox | patch
Permalink /patch/65899/
State New
Headers show

Comments

Sipke Vriend - Jan. 27, 2014, 10:25 p.m.
Add an optional parameter to SSHControl so the user can specify
and alternate port to the default (22).

Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
---
 meta/lib/oeqa/utils/sshcontrol.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index 3e53ec3..8913250 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -13,7 +13,7 @@  import select
 
 class SSHControl(object):
 
-    def __init__(self, ip=None, timeout=300, logfile=None):
+    def __init__(self, ip=None, timeout=300, logfile=None, port=None):
         self.ip = ip
         self.timeout = timeout
         self._starttime = None
@@ -26,6 +26,8 @@  class SSHControl(object):
                 '-o', 'LogLevel=ERROR'
                 ]
         self.ssh = ['ssh', '-l', 'root'] + self.ssh_options
+        if port:
+            self.ssh = self.ssh + ['-p', str(port)]
 
     def log(self, msg):
         if self.logfile: