Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
PAL: Add processing of PPS and CPS tests
[csit.git]
/
resources
/
libraries
/
python
/
ssh.py
diff --git
a/resources/libraries/python/ssh.py
b/resources/libraries/python/ssh.py
index
5359a6e
..
5c397ee
100644
(file)
--- a/
resources/libraries/python/ssh.py
+++ b/
resources/libraries/python/ssh.py
@@
-302,10
+302,11
@@
class SSH:
buf = u""
while not buf.endswith((u":~# ", u":~$ ", u"~]$ ", u"~]# ")):
try:
buf = u""
while not buf.endswith((u":~# ", u":~$ ", u"~]$ ", u"~]# ")):
try:
-
chunk
= chan.recv(self.__MAX_RECV_BUF)
- if not
chunk
:
+
s_out
= chan.recv(self.__MAX_RECV_BUF)
+ if not
s_out
:
break
break
- buf += chunk
+ buf += s_out.decode(encoding=u'utf-8', errors=u'ignore') \
+ if isinstance(s_out, bytes) else s_out
if chan.exit_status_ready():
logger.error(u"Channel exit status ready")
break
if chan.exit_status_ready():
logger.error(u"Channel exit status ready")
break
@@
-335,10
+336,11
@@
class SSH:
buf = u""
while not buf.endswith(prompt):
try:
buf = u""
while not buf.endswith(prompt):
try:
-
chunk
= chan.recv(self.__MAX_RECV_BUF)
- if not
chunk
:
+
s_out
= chan.recv(self.__MAX_RECV_BUF)
+ if not
s_out
:
break
break
- buf += chunk
+ buf += s_out.decode(encoding=u'utf-8', errors=u'ignore') \
+ if isinstance(s_out, bytes) else s_out
if chan.exit_status_ready():
logger.error(u"Channel exit status ready")
break
if chan.exit_status_ready():
logger.error(u"Channel exit status ready")
break