X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fssh.py;h=06cd96010d58fa88e173071be2a1a9c203933e74;hb=b4e5c717f5e2c39ded81f0c6f7b0f9f61945befd;hp=4bed173bbb359005c71294c5d427a8e1328d3dcd;hpb=cc85afad85339d2cc8f035ce63ff21220d8e6b96;p=csit.git diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py index 4bed173bbb..06cd96010d 100644 --- a/resources/libraries/python/ssh.py +++ b/resources/libraries/python/ssh.py @@ -244,7 +244,7 @@ class SSH(object): command = 'sudo -S {c}'.format(c=command) return self.exec_command(command, timeout) - def interactive_terminal_open(self, time_out=30): + def interactive_terminal_open(self, time_out=45): """Open interactive terminal on a new channel on the connected Node. :param time_out: Timeout in seconds. @@ -264,7 +264,7 @@ class SSH(object): chan.set_combine_stderr(True) buf = '' - while not buf.endswith((":~$ ", "~]$ ", "~]# ")): + while not buf.endswith((":~# ", ":~$ ", "~]$ ", "~]# ")): try: chunk = chan.recv(self.__MAX_RECV_BUF) if not chunk: @@ -370,7 +370,7 @@ def exec_cmd(node, cmd, timeout=600, sudo=False): raise TypeError('Node parameter is None') if cmd is None: raise TypeError('Command parameter is None') - if len(cmd) == 0: + if not cmd: raise ValueError('Empty command parameter') ssh = SSH()