diff options
-rw-r--r-- | meta/lib/oeqa/core/target/ssh.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py index a2eafcd6f2..927d659525 100644 --- a/meta/lib/oeqa/core/target/ssh.py +++ b/meta/lib/oeqa/core/target/ssh.py | |||
@@ -6,6 +6,7 @@ import time | |||
6 | import select | 6 | import select |
7 | import logging | 7 | import logging |
8 | import subprocess | 8 | import subprocess |
9 | import codecs | ||
9 | 10 | ||
10 | from . import OETarget | 11 | from . import OETarget |
11 | 12 | ||
@@ -206,12 +207,12 @@ def SSHCall(command, logger, timeout=None, **opts): | |||
206 | logger.debug('time: %s, endtime: %s' % (time.time(), endtime)) | 207 | logger.debug('time: %s, endtime: %s' % (time.time(), endtime)) |
207 | try: | 208 | try: |
208 | if select.select([process.stdout], [], [], 5)[0] != []: | 209 | if select.select([process.stdout], [], [], 5)[0] != []: |
209 | data = os.read(process.stdout.fileno(), 1024) | 210 | reader = codecs.getreader('utf-8')(process.stdout) |
211 | data = reader.read(1024, 1024) | ||
210 | if not data: | 212 | if not data: |
211 | process.stdout.close() | 213 | process.stdout.close() |
212 | eof = True | 214 | eof = True |
213 | else: | 215 | else: |
214 | data = data.decode("utf-8", errors='replace') | ||
215 | output += data | 216 | output += data |
216 | logger.debug('Partial data from SSH call: %s' % data) | 217 | logger.debug('Partial data from SSH call: %s' % data) |
217 | endtime = time.time() + timeout | 218 | endtime = time.time() + timeout |