@@ -141,7 +141,16 @@ def get_ec2_instances(stack, config):
141
141
temp_resources = []
142
142
143
143
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
145
154
temp_resources .extend (resources )
146
155
if not resources .next_token :
147
156
break
@@ -165,7 +174,16 @@ def get_asg_instances(stack, config):
165
174
temp_resources = []
166
175
167
176
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
169
187
temp_resources .extend (resources )
170
188
if not resources .next_token :
171
189
break
@@ -207,7 +225,7 @@ def status(args):
207
225
sys .stdout .write ('\r Status: %s' % status )
208
226
sys .stdout .flush ()
209
227
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' ) ):
211
229
time .sleep (5 )
212
230
status = cfnconn .describe_stacks (stack )[0 ].stack_status
213
231
events = cfnconn .describe_stack_events (stack )[0 ]
0 commit comments