]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: remove runner.show API
authorEd Bartosh <ed.bartosh@linux.intel.com>
Sun, 26 Mar 2017 17:34:27 +0000 (20:34 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 31 Mar 2017 11:12:13 +0000 (12:12 +0100)
Replaced runner.show call to exec_cmd call in bootimg-pcbios
plugin. Removed runner.show API as it's not used anywhere else.

[YOCTO #10618]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
scripts/lib/wic/plugins/source/bootimg-pcbios.py
scripts/lib/wic/utils/runner.py

index bfb8ff5a9697a4a6daf237a8c7d66d4e607e4cee..5890c1267bc50f83b473c0cd91c67740c062d57d 100644 (file)
@@ -81,10 +81,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
         logger.debug("Installing MBR on disk %s as %s with size %s bytes",
                      disk_name, full_path, disk.min_size)
 
-        rcode = runner.show(['dd', 'if=%s' % mbrfile,
-                             'of=%s' % full_path, 'conv=notrunc'])
-        if rcode != 0:
-            raise WicError("Unable to set MBR to %s" % full_path)
+        dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
+        exec_cmd(dd_cmd, native_sysroot)
 
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
index 56d7ea3adfd557693a0d0ead5170584066699c61..348557aee81da98c269b1daea47b337d87162aa8 100644 (file)
@@ -82,30 +82,6 @@ def runtool(cmdln_or_args, catch=1):
 
     return (process.returncode, out)
 
-def show(cmdln_or_args):
-    """Show all messages using logger.debug."""
-
-    rcode, out = runtool(cmdln_or_args, catch=3)
-
-    if isinstance(cmdln_or_args, list):
-        cmd = ' '.join(cmdln_or_args)
-    else:
-        cmd = cmdln_or_args
-
-    msg = 'running command: "%s"' % cmd
-    if out:
-        out = out.strip()
-    if out:
-        msg += ', with output::'
-        msg += '\n  +----------------'
-        for line in out.splitlines():
-            msg += '\n  | %s' % line
-        msg += '\n  +----------------'
-
-    logger.debug(msg)
-
-    return rcode
-
 def outs(cmdln_or_args, catch=1):
     # get the outputs of tools
     return runtool(cmdln_or_args, catch)[1].strip()