Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else:
raise
change_set_id = response["Id"]
response = wait_till_change_set_complete(
cfn_client, change_set_id
)
status = response["Status"]
if status == "FAILED":
status_reason = response["StatusReason"]
if "didn't contain changes" in response["StatusReason"]:
logger.debug(
"Stack %s did not change, not updating.",
fqn,
)
raise exceptions.StackDidNotChange
raise exceptions.UnhandledChangeSetStatus(
fqn, change_set_id, status, status_reason
)
execution_status = response["ExecutionStatus"]
if execution_status != "AVAILABLE":
raise exceptions.UnableToExecuteChangeSet(fqn,
change_set_id,
execution_status)
changes = response["Changes"]
return changes, change_set_id
if ("didn't contain changes" in response["StatusReason"] or
"No updates are to be performed" in response["StatusReason"]):
logger.debug(
"Stack %s did not change, not updating and removing "
"changeset.",
fqn,
)
cfn_client.delete_change_set(ChangeSetName=change_set_id)
raise exceptions.StackDidNotChange()
logger.warn(
"Got strange status, '%s' for changeset '%s'. Not deleting for "
"further investigation - you will need to delete the changeset "
"manually.",
status, change_set_id
)
raise exceptions.UnhandledChangeSetStatus(
fqn, change_set_id, status, status_reason
)
execution_status = response["ExecutionStatus"]
if execution_status != "AVAILABLE":
raise exceptions.UnableToExecuteChangeSet(fqn,
change_set_id,
execution_status)
changes = response["Changes"]
return changes, change_set_id
if ("didn't contain changes" in response["StatusReason"] or
"No updates are to be performed" in response["StatusReason"]):
logger.debug(
"Stack %s did not change, not updating and removing "
"changeset.",
fqn,
)
cfn_client.delete_change_set(ChangeSetName=change_set_id)
raise exceptions.StackDidNotChange()
logger.warn(
"Got strange status, '%s' for changeset '%s'. Not deleting for "
"further investigation - you will need to delete the changeset "
"manually.",
status, change_set_id
)
raise exceptions.UnhandledChangeSetStatus(
fqn, change_set_id, status, status_reason
)
execution_status = response["ExecutionStatus"]
if execution_status != "AVAILABLE":
raise exceptions.UnableToExecuteChangeSet(fqn,
change_set_id,
execution_status)
changes = response["Changes"]
return changes, change_set_id
def __init__(self, stack_name, change_set_id, status, status_reason):
self.stack_name = stack_name
self.id = change_set_id
self.status = status
self.status_reason = status_reason
message = (
"Changeset '%s' on stack '%s' returned an unhandled status "
"'%s: %s'." % (change_set_id, stack_name, status,
status_reason)
)
super(UnhandledChangeSetStatus, self).__init__(message)