@@ -141,7 +141,16 @@ def get_ec2_instances(stack, config):
141141 temp_resources = []
142142
143143 while True :
144- resources = cfnconn .describe_stack_resources (stack )
144+ try :
145+ resources = cfnconn .describe_stack_resources (stack )
146+ except boto .exception .BotoServerError as e :
147+ if e .message .endswith ("does not exist" ):
148+ #sys.stdout.write('\r\n')
149+ print e .message
150+ sys .stdout .flush ()
151+ sys .exit (0 )
152+ else :
153+ raise e
145154 temp_resources .extend (resources )
146155 if not resources .next_token :
147156 break
@@ -165,7 +174,16 @@ def get_asg_instances(stack, config):
165174 temp_resources = []
166175
167176 while True :
168- resources = cfnconn .describe_stack_resources (stack )
177+ try :
178+ resources = cfnconn .describe_stack_resources (stack )
179+ except boto .exception .BotoServerError as e :
180+ if e .message .endswith ("does not exist" ):
181+ #sys.stdout.write('\r\n')
182+ print e .message
183+ sys .stdout .flush ()
184+ sys .exit (0 )
185+ else :
186+ raise e
169187 temp_resources .extend (resources )
170188 if not resources .next_token :
171189 break
@@ -207,7 +225,7 @@ def status(args):
207225 sys .stdout .write ('\r Status: %s' % status )
208226 sys .stdout .flush ()
209227 if not args .nowait :
210- while ((status != 'CREATE_COMPLETE' ) and (status != 'UPDATE_COMPLETE' )):
228+ while ((status != 'CREATE_COMPLETE' ) and (status != 'UPDATE_COMPLETE' ) and ( status != 'ROLLBACK_COMPLETE' ) ):
211229 time .sleep (5 )
212230 status = cfnconn .describe_stacks (stack )[0 ].stack_status
213231 events = cfnconn .describe_stack_events (stack )[0 ]
0 commit comments