Skip to content

Commit

Permalink
fix: handle destroy with missing security group (#381)
Browse files Browse the repository at this point in the history
This PR makes the following changes:
* Destroying cluser even if security group is missing (for example in
case of ungraceful stop during a previous destroy)

I tested this PR by hand and against incomplete cluster (missing
security group)

Co-authored-by: Nicholas Chammas <[email protected]>
  • Loading branch information
karsten-adot and nchammas authored Dec 13, 2024
1 parent a11946d commit 3cce613
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flintrock/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ def destroy(self):
region=self.region,
cluster_name=self.name,
)
cluster_group.delete()
# Cluster group might already have been killed if a destroy was ungracefully stopped during
# a previous execution.
if cluster_group:
cluster_group.delete()

(ec2.instances
.filter(
Expand Down

0 comments on commit 3cce613

Please sign in to comment.