Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix ssh prompts for centos
[csit.git]
/
resources
/
libraries
/
python
/
ssh.py
diff --git
a/resources/libraries/python/ssh.py
b/resources/libraries/python/ssh.py
index
3a2c1b6
..
7b15998
100644
(file)
--- a/
resources/libraries/python/ssh.py
+++ b/
resources/libraries/python/ssh.py
@@
-220,7
+220,7
@@
class SSH(object):
chan.set_combine_stderr(True)
buf = ''
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:
try:
chunk = chan.recv(self.__MAX_RECV_BUF)
if not chunk:
@@
-265,7
+265,9
@@
class SSH(object):
except socket.timeout:
raise Exception('Socket timeout: {0}'.format(buf))
tmp = buf.replace(cmd.replace('\n', ''), '')
except socket.timeout:
raise Exception('Socket timeout: {0}'.format(buf))
tmp = buf.replace(cmd.replace('\n', ''), '')
- return tmp.replace(prompt, '')
+ for p in prompt:
+ tmp.replace(p, '')
+ return tmp
@staticmethod
def interactive_terminal_close(chan):
@staticmethod
def interactive_terminal_close(chan):