Skip to content

Commit

Permalink
Fix execution on empty change-sets
Browse files Browse the repository at this point in the history
Our execute change-set command was attempting to execute all change sets
even if the change-set creation had failed due to no changes.

This commit adds a filter for change-sets that have failed because there
were no changes. Information is logged to the user and sceptre continues
launching all change-sets that were successfully created.

[Resolves #846]
  • Loading branch information
ngfgrant committed Jun 21, 2020
1 parent b4d5742 commit 20b824a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sceptre/plan/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,17 @@ def execute_change_set(self, change_set_name):
:rtype: str
"""
self._protect_execution()
change_set = self.describe_change_set(change_set_name)
status = change_set.get("Status")
reason = change_set.get("StatusReason")
if status == "FAILED" and "submitted information didn't contain changes" in reason:
self.logger.info(
"Skipping ChangeSet on Stack: {} - there are no changes".format(
change_set.get("StackName")
)
)
return 0

self.logger.debug(
"%s - Executing Change Set '%s'", self.stack.name, change_set_name
)
Expand Down

0 comments on commit 20b824a

Please sign in to comment.