From 45f4fe136c763ecd7724cb4ffc6e7025cb3b5442 Mon Sep 17 00:00:00 2001 From: Binal Panchal <51986238+binalp7@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:15:43 +0530 Subject: [PATCH] PIN-15522 | Rescue Waiter FailureStateError (#299) --- lib/moonshot/change_set.rb | 14 +++++++++++--- lib/moonshot/unicode_table.rb | 2 -- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/moonshot/change_set.rb b/lib/moonshot/change_set.rb index 8414ca86..4741dc32 100644 --- a/lib/moonshot/change_set.rb +++ b/lib/moonshot/change_set.rb @@ -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) diff --git a/lib/moonshot/unicode_table.rb b/lib/moonshot/unicode_table.rb index 9d580388..813a8820 100644 --- a/lib/moonshot/unicode_table.rb +++ b/lib/moonshot/unicode_table.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'colorize' module Moonshot