Make a copy of the procedure arguments before expanding the values from the context, or we'll permanently overwrite the procedure arguments with expanded values

This commit is contained in:
Fabio Manganiello 2019-02-15 11:45:11 +01:00
parent 1103e417e1
commit f8e5515640

View file

@ -121,11 +121,12 @@ class Procedure(object):
n_tries -- Number of tries in case of failure before raising a RuntimeError
"""
if self.args:
for (k,v) in self.args.items():
args = self.args.copy()
for (k,v) in args.items():
v = Request.expand_value_from_context(v, **context)
self.args[k] = v
args[k] = v
context[k] = v
logger.info('Executing procedure {} with arguments {}'.format(self.name, self.args))
logger.info('Executing procedure {} with arguments {}'.format(self.name, args))
else:
logger.info('Executing procedure {}'.format(self.name))