summaryrefslogtreecommitdiff
path: root/morphlib/builder2.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-08-06 14:53:26 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-08-06 15:35:08 +0000
commit5261ebca7a0d4e3dfc86b9ad8655c2587e7d0548 (patch)
tree97c2dca250adc513f82b7548b8e981b137fcda88 /morphlib/builder2.py
parent4fa9c69157ee93e01d9a2cb3edd12ffc4e2708e1 (diff)
downloadmorph-5261ebca7a0d4e3dfc86b9ad8655c2587e7d0548.tar.gz
stagingarea: move to failed on construction fail
This uses the same logic as when a build fails, so it's been consolidated into `StagingArea.abort()`. You could argue that if a build fails before any commands are run, then there's nothing interesting to see, but it will be useful if the hardlink/tarball extract algorithm fails in some corner case.
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r--morphlib/builder2.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 62fd5480..daf50b56 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -354,10 +354,7 @@ class ChunkBuilder(BuilderBase):
for line in f:
logging.error('OUTPUT FROM FAILED BUILD: %s' %
line.rstrip('\n'))
- src_dir = self.staging_area.dirname
- dest_dir = os.path.join(self.app.settings['tempdir'],
- 'failed', os.path.basename(src_dir))
- os.rename(src_dir, dest_dir)
+ self.staging_area.abort()
raise
self.staging_area.chroot_close()
built_artifacts = self.assemble_chunk_artifacts(destdir)