Fix various substitution issues
This PS solves the following issues for which only minor changes were needed: 1) Using copy.copy() around the substitution value passed in to jsonpath_replace so as to avoid updating the substitution entry referentially which was happening before this change, causing future substitutions using that entry to fail or behaving unexpectedly. 2) Supporting non-string substitution values when a substitution pattern is provided: before this change, this was failing because calling re.sub() and passing in a non-string value causes an error to be thrown. 3) Adding better logging and error handling to deckhand.utils.jsonpath_replace to assist with debugging. Unit tests are included for some of the scenarios above. Change-Id: I8562d43a717f477e3297504c1522331b3a993f88
This commit is contained in:
@@ -215,8 +215,7 @@ class SecretsSubstitution(object):
|
||||
except Exception as e:
|
||||
LOG.error('Unexpected exception occurred while attempting '
|
||||
'secret substitution. %s', six.text_type(e))
|
||||
raise errors.SubstitutionDependencyNotFound(
|
||||
details=six.text_type(e))
|
||||
raise errors.SubstitutionFailure(details=six.text_type(e))
|
||||
|
||||
yield document
|
||||
|
||||
|
||||
Reference in New Issue
Block a user