summaryrefslogtreecommitdiff
path: root/morphlib/builder2.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-18 10:26:04 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-18 10:26:04 +0000
commitc57952ef44a0f1f161441970fcf2f27a39b0de7c (patch)
treeb4fee53259020cb4d3da21e352041fac3edf93f5 /morphlib/builder2.py
parent70858749d82afe841d06f6a96350168bc3ba51f7 (diff)
parent9449dbfe1bb1800dfb15de025b87e1846e25e74a (diff)
downloadmorph-c57952ef44a0f1f161441970fcf2f27a39b0de7c.tar.gz
Merge branch 'sam/improve-command-failure-errors'
Reviewed-By: Richard Ipsum <richard.ipsum@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk> Reviewed-By: Daniel Silverstone <daniel.silverstone@codethink.co.uk> Reviewed-By: Mike Smith <mike.smith@codethink.co.uk>
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r--morphlib/builder2.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index f71f21db..9e158ea1 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -665,11 +665,18 @@ class SystemBuilder(BuilderBase): # pragma: no cover
)
try:
for bin in sorted(os.listdir(sys_integration_dir)):
- self.app.runcmd(
- morphlib.util.containerised_cmdline(
- [os.path.join(SYSTEM_INTEGRATION_PATH, bin)],
- root=rootdir, mounts=to_mount, mount_proc=True),
- env=env)
+ argv = [os.path.join(SYSTEM_INTEGRATION_PATH, bin)]
+ container_config = dict(
+ root=rootdir, mounts=to_mount, mount_proc=True)
+ cmdline = morphlib.util.containerised_cmdline(
+ argv, **container_config)
+ exit, out, err = self.app.runcmd_unchecked(
+ cmdline, env=env)
+ if exit != 0:
+ logging.debug('Command returned code %i', exit)
+ msg = error_message_for_containerised_commandline(
+ argv, err, container_config)
+ raise cliapp.AppException(msg)
except BaseException, e:
self.app.status(
msg='Error while running system integration commands',