Add negative functional test for substitution

It is currently surprising for users when null is getting substituted
into documents when there is no actual source data to grab.

Silent "None" substitution sometimes results in surprising symptoms in
complex configurations.

Depends-On: If2b08f443cde765a1dbfaf7bac6b549591e59148
Change-Id: I253dc1d10f9493b9611fb6abd86810c6d57afbf6
This commit is contained in:
Mark Burnett
2018-04-05 14:01:11 -05:00
committed by Scott Hussey
parent 6b9cd17e98
commit 7086973386
4 changed files with 77 additions and 3 deletions

View File

@@ -365,9 +365,10 @@ class SecretsSubstitution(object):
dest_path = sub['dest']['path']
dest_pattern = sub['dest'].get('pattern', None)
LOG.debug('Substituting from schema=%s name=%s src_path=%s '
'into dest_path=%s, dest_pattern=%s', src_schema,
src_name, src_path, dest_path, dest_pattern)
LOG.debug('Substituting from schema=%s layer=%s name=%s '
'src_path=%s into dest_path=%s, dest_pattern=%s',
src_schema, src_doc.layer, src_name, src_path,
dest_path, dest_pattern)
try:
exc_message = ''
substituted_data = utils.jsonpath_replace(