autobuild: py3: cope with bytes when compiling system-info.txt
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 11 Dec 2018 21:17:38 +0000 (10:17 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Dec 2018 03:38:13 +0000 (04:38 +0100)
The command output looks like b'foo\nbar' in string-space.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
script/autobuild.py

index c71b85a85b460c4685b1e8b2a19036f95633d15a..f26a5b2095e6716941c291c8b4866d19eb2233e3 100755 (executable)
@@ -608,10 +608,15 @@ class buildlist(object):
     def write_system_info(self):
         filename = 'system-info.txt'
         f = open(filename, 'w')
-        for cmd in ['uname -a', 'free', 'cat /proc/cpuinfo',
-                    'cc --version', 'df -m .', 'df -m %s' % testbase]:
+        for cmd in ['uname -a',
+                    'free',
+                    'cat /proc/cpuinfo',
+                    'cc --version',
+                    'df -m .',
+                    'df -m %s' % testbase]:
+            out = run_cmd(cmd, output=True, checkfail=False)
             print('### %s' % cmd, file=f)
-            print(run_cmd(cmd, output=True, checkfail=False), file=f)
+            print(out.decode('utf8', 'backslashreplace'), file=f)
             print(file=f)
         f.close()
         return filename