Skip to content

Commit

Permalink
PIN-15522 | Rescue Waiter FailureStateError (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
binalp7 authored Oct 16, 2023
1 parent 5406f6c commit 45f4fe1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 11 additions & 3 deletions lib/moonshot/change_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,17 @@ def delete
end

def wait_for_change_set
@cf_client.wait_until(:change_set_create_complete,
stack_name: @stack_name,
change_set_name: @name)
begin
@cf_client.wait_until(:change_set_create_complete,
stack_name: @stack_name,
change_set_name: @name)
rescue Aws::Waiters::Errors::FailureStateError => e
if e.message != 'stopped waiting, encountered a failure state'
throw e
else
puts "The change set didn't contain any new changes."
end
end

@change_set = @cf_client.describe_change_set(stack_name: @stack_name,
change_set_name: @name)
Expand Down
2 changes: 0 additions & 2 deletions lib/moonshot/unicode_table.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

require 'colorize'

module Moonshot
Expand Down

0 comments on commit 45f4fe1

Please sign in to comment.