Merge "Ensure Boolean Strings from the environment are treated correctly"

This commit is contained in:
Zuul 2018-02-06 02:51:52 +00:00 committed by Gerrit Code Review
commit fb72923351
1 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,13 @@ for k, v in os.environ.items():
endpoint_context[k] = v
context.update(endpoint_context)
# Make sure boolean strings are treated as Bool()
for k, v in list(context.items()):
if v == 'False':
context[k] = False
elif v == 'True':
context[k] = True
with open(template) as f:
puppet_stack_config_yaml = renderer.render(f.read(), context)