Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def log_step(step):
msg = "%s: %s" % (step, step.status.name)
if step.status.reason:
msg += " (%s)" % (step.status.reason)
color_code = COLOR_CODES.get(step.status.code, 37)
ui.info(msg, extra={"color": color_code})
old_template = parse_cloudformation_template(old_template)
if isinstance(old_template, str):
# YAML templates returned from CFN need parsing again
# "AWSTemplateFormatVersion: \"2010-09-09\"\nParam..."
# ->
# AWSTemplateFormatVersion: "2010-09-09"
old_template = parse_cloudformation_template(old_template)
old_stack = normalize_json(
json.dumps(old_template,
sort_keys=True,
indent=4,
default=str)
)
output.extend(build_stack_changes(stack.name, new_stack, old_stack,
new_params, old_params))
ui.info('\n' + '\n'.join(output))
stack.set_outputs(
provider.get_output_dict(provider_stack))
return COMPLETE