summaryrefslogtreecommitdiff
path: root/morphlib/builder2.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-04-12 13:15:39 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-04-12 13:15:39 +0000
commite7e90384da00a8197c5e0363a5a4005754a790eb (patch)
tree5e15b4065ca1a39b9baa7d83868ff1b431f4a0d5 /morphlib/builder2.py
parent967735355fe57b0dbd5b2c744945c8b4ee26a511 (diff)
parent7c5487a695ab8353e9e98116a7165722cdd9f61e (diff)
downloadmorph-e7e90384da00a8197c5e0363a5a4005754a790eb.tar.gz
Merge remote-tracking branch 'origin/baserock/richardholland/empty-stratum-error'
Reviewed-by: Lars Wirzenius
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r--morphlib/builder2.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index f8f4ea88..7ded281e 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -471,7 +471,7 @@ class StratumBuilder(BuilderBase):
constituents = [d for d in self.artifact.dependencies
if self.is_constituent(d)]
if len(constituents) == 0:
- logging.warning('Stratum %s is empty' % self.artifact.name)
+ raise EmptyStratumError(self.artifact.name)
# the only reason the StratumBuilder has to download chunks is to
# check for overlap now that strata are lists of chunks
@@ -854,3 +854,9 @@ class DiskImageBuilder(SystemKindBuilder): # pragma: no cover
filename=image_name, chatty=True)
with self.build_watch('undo-device-mapper'):
morphlib.fsutils.undo_device_mapping(self.app.runcmd, image_name)
+
+class EmptyStratumError(cliapp.AppException):
+
+ def __init__(self, stratum_name): # pragma: no cover
+ cliapp.AppException.__init__(self,
+ "Stratum %s is empty (has no dependencies)" % stratum_name)