diff --git a/promenade/cli.py b/promenade/cli.py index 694f3e05..9bd3e015 100644 --- a/promenade/cli.py +++ b/promenade/cli.py @@ -31,7 +31,10 @@ def build_all(*, config_files, output_dir, validators): debug = _debug() try: c = config.Configuration.from_streams( - debug=debug, streams=config_files) + debug=debug, + substitute=True, + allow_missing_substitutions=False, + streams=config_files) b = builder.Builder(c, validators=validators) b.build_all(output_dir=output_dir) except exceptions.PromenadeException as e: @@ -52,7 +55,11 @@ def genereate_certs(*, config_files, output_dir): debug = _debug() try: c = config.Configuration.from_streams( - debug=debug, streams=config_files, substitute=True, validate=False) + debug=debug, + streams=config_files, + substitute=True, + allow_missing_substitutions=True, + validate=False) g = generator.Generator(c) g.generate(output_dir) except exceptions.PromenadeException as e: diff --git a/promenade/config.py b/promenade/config.py index 9205770c..8886bb75 100644 --- a/promenade/config.py +++ b/promenade/config.py @@ -18,6 +18,7 @@ class Configuration: documents, debug=False, substitute=True, + allow_missing_substitutions=True, validate=True): LOG.info("Parsing document schemas.") schema_set = validation.load_schemas_from_docs(documents) @@ -29,12 +30,12 @@ class Configuration: deckhand_eng = layering.DocumentLayering( documents, substitution_sources=documents, - fail_on_missing_sub_src=False) + fail_on_missing_sub_src=not allow_missing_substitutions) documents = [dict(d) for d in deckhand_eng.render()] except dh_errors.DeckhandException as e: - LOG.exception(str(e)) - LOG.error('An unknown Deckhand exception occurred while trying' - ' to render documents.') + LOG.exception( + 'An unknown Deckhand exception occurred while trying' + ' to render documents.') raise exceptions.DeckhandException(str(e)) LOG.info("Deckhand engine returned %d documents." % len(documents)) diff --git a/promenade/control/join_scripts.py b/promenade/control/join_scripts.py index 957ad6e3..83bf241e 100644 --- a/promenade/control/join_scripts.py +++ b/promenade/control/join_scripts.py @@ -43,7 +43,8 @@ class JoinScriptsResource(BaseResource): join_ip = _get_join_ip() try: - config = Configuration.from_design_ref(design_ref) + config = Configuration.from_design_ref( + design_ref, allow_missing_substitutions=False) except exceptions.DeckhandException as e: raise falcon.HTTPInternalServerError(description=str(e))