summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/utils')
-rw-r--r--scripts/lib/wic/utils/misc.py6
-rw-r--r--scripts/lib/wic/utils/runner.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/lib/wic/utils/misc.py b/scripts/lib/wic/utils/misc.py
index b7b835afbb..94fdab2669 100644
--- a/scripts/lib/wic/utils/misc.py
+++ b/scripts/lib/wic/utils/misc.py
@@ -33,6 +33,7 @@ import re
33from collections import defaultdict 33from collections import defaultdict
34from distutils import spawn 34from distutils import spawn
35 35
36from wic.errors import WicError
36from wic.utils import runner 37from wic.utils import runner
37 38
38logger = logging.getLogger('wic') 39logger = logging.getLogger('wic')
@@ -74,9 +75,8 @@ def _exec_cmd(cmd_and_args, as_shell=False, catch=3):
74 ret, out = runner.runtool(args, catch) 75 ret, out = runner.runtool(args, catch)
75 out = out.strip() 76 out = out.strip()
76 if ret != 0: 77 if ret != 0:
77 logger.error("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % \ 78 raise WicError("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % \
78 (cmd_and_args, ret, out)) 79 (cmd_and_args, ret, out))
79 sys.exit(1)
80 80
81 logger.debug("_exec_cmd: output for %s (rc = %d): %s", 81 logger.debug("_exec_cmd: output for %s (rc = %d): %s",
82 cmd_and_args, ret, out) 82 cmd_and_args, ret, out)
diff --git a/scripts/lib/wic/utils/runner.py b/scripts/lib/wic/utils/runner.py
index d27dcc7afd..5ede1929a3 100644
--- a/scripts/lib/wic/utils/runner.py
+++ b/scripts/lib/wic/utils/runner.py
@@ -18,7 +18,8 @@
18import logging 18import logging
19import os 19import os
20import subprocess 20import subprocess
21import sys 21
22from wic.errors import WicError
22 23
23logger = logging.getLogger('wic') 24logger = logging.getLogger('wic')
24 25
@@ -72,8 +73,7 @@ def runtool(cmdln_or_args, catch=1):
72 except OSError as err: 73 except OSError as err:
73 if err.errno == 2: 74 if err.errno == 2:
74 # [Errno 2] No such file or directory 75 # [Errno 2] No such file or directory
75 logger.error('Cannot run command: %s, lost dependency?', cmd) 76 raise WicError('Cannot run command: %s, lost dependency?' % cmd)
76 sys.exit(1)
77 else: 77 else:
78 raise # relay 78 raise # relay
79 finally: 79 finally: