[yocto] [layerindex-web][PATCH 2/4] utils: fix error in runcmd() if printerr=False

Paul Eggleton paul.eggleton at linux.intel.com
Tue Nov 15 19:18:32 PST 2016


If you specified printerr=False we were referring to the output variable
that hadn't been set. Looks like I broke this back in 2013 in
93ce26f21cdbbd8a645792359cde87acf05144d7.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 layerindex/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layerindex/utils.py b/layerindex/utils.py
index e3be631..9248077 100644
--- a/layerindex/utils.py
+++ b/layerindex/utils.py
@@ -190,9 +190,9 @@ def runcmd(cmd, destdir=None, printerr=True, logger=None):
         subprocess.check_call(cmd, stdout=out, stderr=out, cwd=destdir, shell=True)
     except subprocess.CalledProcessError as e:
         out.seek(0)
+        output = out.read()
+        output = output.decode('ascii').strip()
         if printerr:
-            output = out.read()
-            output = output.decode('ascii').strip()
             if logger:
                 logger.error("%s" % output)
             else:
-- 
2.5.5




More information about the yocto mailing list