From b5b0b231a8f3b5b4cd93720d56ec86f8f83101d4 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 30 Jul 2015 11:10:14 +0000 Subject: 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 --- morphlib/builder.py | 7 +++++++ 1 file changed, 7 insertions(+) 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(): -- cgit v1.2.1