Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] lib/oeqa: sshcontrol: Allow alternate port for SSHControl
@ 2014-01-23  0:35 Sipke Vriend
  2014-01-23  8:49 ` Stanacar, StefanX
  0 siblings, 1 reply; 2+ messages in thread
From: Sipke Vriend @ 2014-01-23  0:35 UTC (permalink / raw)
  To: openembedded-core

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(-)

diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index a0dcf02..7bdf2e7 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 is not None:
+            self.ssh = self.ssh + ['-p', str(port)]
 
     def log(self, msg):
         if self.logfile:
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lib/oeqa: sshcontrol: Allow alternate port for SSHControl
  2014-01-23  0:35 [PATCH] lib/oeqa: sshcontrol: Allow alternate port for SSHControl Sipke Vriend
@ 2014-01-23  8:49 ` Stanacar, StefanX
  0 siblings, 0 replies; 2+ messages in thread
From: Stanacar, StefanX @ 2014-01-23  8:49 UTC (permalink / raw)
  To: sipke.vriend@xilinx.com; +Cc: openembedded-core@lists.openembedded.org




On Thu, 2014-01-23 at 10:35 +1000, Sipke Vriend wrote:
> 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(-)
> 
> diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
> index a0dcf02..7bdf2e7 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 is not None:

Nitpicking really, but 'if port:' would have been nicer ;-)

Cheers,
Stefan

> +            self.ssh = self.ssh + ['-p', str(port)]
>  
>      def log(self, msg):
>          if self.logfile:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-23  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-23  0:35 [PATCH] lib/oeqa: sshcontrol: Allow alternate port for SSHControl Sipke Vriend
2014-01-23  8:49 ` Stanacar, StefanX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox