summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/utils/runner.py')
-rw-r--r--scripts/lib/wic/utils/runner.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/lib/wic/utils/runner.py b/scripts/lib/wic/utils/runner.py
index db536ba588..d27dcc7afd 100644
--- a/scripts/lib/wic/utils/runner.py
+++ b/scripts/lib/wic/utils/runner.py
@@ -15,10 +15,12 @@
15# with this program; if not, write to the Free Software Foundation, Inc., 59 15# with this program; if not, write to the Free Software Foundation, Inc., 59
16# Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 17
18import logging
18import os 19import os
19import subprocess 20import subprocess
21import sys
20 22
21from wic import msger 23logger = logging.getLogger('wic')
22 24
23def runtool(cmdln_or_args, catch=1): 25def runtool(cmdln_or_args, catch=1):
24 """ wrapper for most of the subprocess calls 26 """ wrapper for most of the subprocess calls
@@ -70,7 +72,8 @@ def runtool(cmdln_or_args, catch=1):
70 except OSError as err: 72 except OSError as err:
71 if err.errno == 2: 73 if err.errno == 2:
72 # [Errno 2] No such file or directory 74 # [Errno 2] No such file or directory
73 msger.error('Cannot run command: %s, lost dependency?' % cmd) 75 logger.error('Cannot run command: %s, lost dependency?', cmd)
76 sys.exit(1)
74 else: 77 else:
75 raise # relay 78 raise # relay
76 finally: 79 finally:
@@ -80,7 +83,7 @@ def runtool(cmdln_or_args, catch=1):
80 return (process.returncode, out) 83 return (process.returncode, out)
81 84
82def show(cmdln_or_args): 85def show(cmdln_or_args):
83 # show all the message using msger.verbose 86 """Show all messages using logger.debug."""
84 87
85 rcode, out = runtool(cmdln_or_args, catch=3) 88 rcode, out = runtool(cmdln_or_args, catch=3)
86 89
@@ -99,7 +102,8 @@ def show(cmdln_or_args):
99 msg += '\n | %s' % line 102 msg += '\n | %s' % line
100 msg += '\n +----------------' 103 msg += '\n +----------------'
101 104
102 msger.verbose(msg) 105 logger.debug(msg)
106
103 return rcode 107 return rcode
104 108
105def outs(cmdln_or_args, catch=1): 109def outs(cmdln_or_args, catch=1):