]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/target/ssh: Replace suggogatepass with ignoring errors
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 May 2019 18:49:25 +0000 (19:49 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 May 2019 19:50:00 +0000 (20:50 +0100)
We continued to see encoding problems with ssh commands run in oeqa. After much
research the conclusion was we should use ignore the errors since some occasional bad
locale encoding is better than the unicode decoding issues we were seeing which crashed
large parts of tests.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/target/ssh.py

index cf3d44d12d55c41780083450443b509b008d3338..51032ef1a9b7aff25b0d8d109e13af31edeff1b1 100644 (file)
@@ -210,7 +210,7 @@ def SSHCall(command, logger, timeout=None, **opts):
                 logger.debug('time: %s, endtime: %s' % (time.time(), endtime))
                 try:
                     if select.select([process.stdout], [], [], 5)[0] != []:
-                        reader = codecs.getreader('utf-8')(process.stdout, 'surrogatepass')
+                        reader = codecs.getreader('utf-8')(process.stdout, 'ignore')
                         data = reader.read(1024, 4096)
                         if not data:
                             process.stdout.close()
@@ -237,7 +237,7 @@ def SSHCall(command, logger, timeout=None, **opts):
                 output += lastline
 
         else:
-            output = process.communicate()[0].decode("utf-8", errors='surrogatepass')
+            output = process.communicate()[0].decode('utf-8', errors='ignore')
             logger.debug('Data from SSH call: %s' % output.rstrip())
 
     options = {