File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2342,9 +2342,13 @@ def _instance_type_from_capacity_reservation(self):
2342
2342
self .capacity_reservation_target .capacity_reservation_id if self .capacity_reservation_target else None
2343
2343
)
2344
2344
if capacity_reservation_id :
2345
- capacity_reservations = AWSApi .instance ().ec2 .describe_capacity_reservations ([capacity_reservation_id ])
2346
- if capacity_reservations :
2347
- instance_type = capacity_reservations [0 ].instance_type ()
2345
+ try :
2346
+ capacity_reservations = AWSApi .instance ().ec2 .describe_capacity_reservations ([capacity_reservation_id ])
2347
+ if capacity_reservations :
2348
+ instance_type = capacity_reservations [0 ].instance_type ()
2349
+ except AWSClientError :
2350
+ # In case the CR has expired and we are unable to retrieve the instance type
2351
+ instance_type = None
2348
2352
return instance_type
2349
2353
2350
2354
You can’t perform that action at this time.
0 commit comments