diff options
Diffstat (limited to 'scripts/lib/wic/utils')
-rw-r--r-- | scripts/lib/wic/utils/misc.py | 6 | ||||
-rw-r--r-- | scripts/lib/wic/utils/runner.py | 6 |
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 | |||
33 | from collections import defaultdict | 33 | from collections import defaultdict |
34 | from distutils import spawn | 34 | from distutils import spawn |
35 | 35 | ||
36 | from wic.errors import WicError | ||
36 | from wic.utils import runner | 37 | from wic.utils import runner |
37 | 38 | ||
38 | logger = logging.getLogger('wic') | 39 | logger = 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 @@ | |||
18 | import logging | 18 | import logging |
19 | import os | 19 | import os |
20 | import subprocess | 20 | import subprocess |
21 | import sys | 21 | |
22 | from wic.errors import WicError | ||
22 | 23 | ||
23 | logger = logging.getLogger('wic') | 24 | logger = 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: |