1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-09 03:40:18 +00:00

wic: use wic logger in core modules

Replaced msger with wic logger in the core wic modules.

(From OE-Core rev: cdd6675951b74075c9b9159f7465a88f83775bac)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2017-02-14 18:54:32 +02:00
committed by Richard Purdie
parent 58ff06f1e7
commit fe2d602240
8 changed files with 104 additions and 77 deletions
+8 -4
View File
@@ -15,10 +15,12 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import logging
import os
import subprocess
import sys
from wic import msger
logger = logging.getLogger('wic')
def runtool(cmdln_or_args, catch=1):
""" wrapper for most of the subprocess calls
@@ -70,7 +72,8 @@ def runtool(cmdln_or_args, catch=1):
except OSError as err:
if err.errno == 2:
# [Errno 2] No such file or directory
msger.error('Cannot run command: %s, lost dependency?' % cmd)
logger.error('Cannot run command: %s, lost dependency?', cmd)
sys.exit(1)
else:
raise # relay
finally:
@@ -80,7 +83,7 @@ def runtool(cmdln_or_args, catch=1):
return (process.returncode, out)
def show(cmdln_or_args):
# show all the message using msger.verbose
"""Show all messages using logger.debug."""
rcode, out = runtool(cmdln_or_args, catch=3)
@@ -99,7 +102,8 @@ def show(cmdln_or_args):
msg += '\n | %s' % line
msg += '\n +----------------'
msger.verbose(msg)
logger.debug(msg)
return rcode
def outs(cmdln_or_args, catch=1):