diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-07-30 11:10:14 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-08-11 13:16:51 +0000 |
commit | b5b0b231a8f3b5b4cd93720d56ec86f8f83101d4 (patch) | |
tree | 7be97bdcd7ab964904f1422d50c01343f571969e | |
parent | cc57b81bbcb7455f32ab42926082f1347f7c51a9 (diff) | |
download | morph-b5b0b231a8f3b5b4cd93720d56ec86f8f83101d4.tar.gz |
Warn if system-integration commands are defined for an unknown artifact
The system-integration field in a chunk .morph file defines which of the
chunk artifacts the integration script should live. If you list an
artifact that doesn't exist, the integration script will not go anywhere
and the commands won't run.
Ideally system-integration commands will be become a bit more simple to
use, but hopefully this warning helps in the meantime.
Change-Id: I10a068e79eb46f98f0bd308a5caf3c445dda22ed
-rw-r--r-- | morphlib/builder.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index 826bd42f..06b4198b 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -24,6 +24,7 @@ import time import traceback import subprocess import tempfile +import warnings import cliapp @@ -446,6 +447,12 @@ class ChunkBuilder(BuilderBase): system_integration = morphology.get(sys_tag) or {} + for artifact in system_integration.keys(): + if artifact not in source.artifacts: + warnings.warn( + "Chunk %s has system-integration commands for " + "non-existent artifact %s." % (source.name, artifact)) + with self.build_watch('create-chunks'): for chunk_artifact_name, chunk_artifact \ in source.artifacts.iteritems(): |