diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-05-28 16:28:28 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-05-28 16:28:28 +0000 |
commit | d5d9b7253f968b67e9c9a3e6d260a6adf1dee8f9 (patch) | |
tree | aa33f3b250505f2f55e870ea9a48337853fe3e86 /morphlib/builder2.py | |
parent | 57d2fc906005e073ba942ce5b89fde3ec1eefece (diff) | |
parent | 6375554363c111fda70b7540c3c56a0e9cf1497b (diff) | |
download | morph-d5d9b7253f968b67e9c9a3e6d260a6adf1dee8f9.tar.gz |
Merge branch 'liw/kill-bare-except'
Reviewed-by: Richard Maw
I, Lars, note that we have an old version of CoverageTestRunner
in Baserock. The new version hides the spurious logging messages.
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r-- | morphlib/builder2.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py index 9aefabb6..59c62222 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -305,7 +305,9 @@ class ChunkBuilder(BuilderBase): log_name = log.real_filename self.run_commands(builddir, destdir, log) self.create_devices(destdir) - except: + except BaseException, e: + logging.error('Caught exception: %s' % str(e)) + logging.info('Cleaning up staging area') self.staging_area.chroot_close() if log_name: with open(log_name) as f: @@ -768,8 +770,11 @@ class DiskImageBuilder(SystemKindBuilder): # pragma: no cover shutil.copyfileobj(ifh, ofh, 1024 * 1024) ofh.close() - except: + except BaseException, e: + logging.error('Caught exception: %s' % str(e)) + logging.info('Removing unfinished disk image %s' % image_name) os.remove(image_name) + logging.info('Removing unfinished file from cache') handle.abort() raise |