X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fssh.py;h=06cd96010d58fa88e173071be2a1a9c203933e74;hb=b4e5c717f5e2c39ded81f0c6f7b0f9f61945befd;hp=7518cabcc3ce7123c8f9f28968d20b742c2cc2dd;hpb=fb7a7ea16d547b48c69143f612f7b5dea0a0826a;p=csit.git diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py index 7518cabcc3..06cd96010d 100644 --- a/resources/libraries/python/ssh.py +++ b/resources/libraries/python/ssh.py @@ -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()