Convert binary strings to strings and strip leading/trailing whitespace prior to returning errors and output.
Signed-off-by: Liam R. Howlett <liam.howl...@windriver.com> --- layerindex/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layerindex/utils.py b/layerindex/utils.py index 50268e0..23b81f5 100644 --- a/layerindex/utils.py +++ b/layerindex/utils.py @@ -32,7 +32,8 @@ def runcmd(cmd, destdir=None, printerr=True, logger=None): execute command, raise CalledProcessError if fail return output if succeed """ - #logger.debug("run cmd '%s' in %s" % (cmd, os.getcwd() if destdir is None else destdir)) + if logger: + logger.debug("run cmd '%s' in %s" % (cmd, os.getcwd() if destdir is None else destdir)) out = tempfile.TemporaryFile() try: subprocess.check_call(cmd, stdout=out, stderr=out, cwd=destdir, shell=True) @@ -40,6 +41,7 @@ def runcmd(cmd, destdir=None, printerr=True, logger=None): out.seek(0) if printerr: output = out.read() + output = output.decode('ascii').strip() if logger: logger.error("%s" % output) else: @@ -49,7 +51,9 @@ def runcmd(cmd, destdir=None, printerr=True, logger=None): out.seek(0) output = out.read() - #logger.debug("output: %s" % output.rstrip() ) + output = output.decode('ascii').strip() + if logger: + logger.debug("output: %s" % output.rstrip() ) return output def setup_django(): -- 1.9.1 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto