Skip to content

Commit

Permalink
If security group is not found on destroy, assume it has been destroy…
Browse files Browse the repository at this point in the history
…ed already.
  • Loading branch information
rbvermaa committed Jan 30, 2017
1 parent 4671155 commit 04ab6c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nixops/resources/ec2_security_group.py
Expand Up @@ -221,6 +221,11 @@ def destroy(self, wipe=False):
self.logger.log("deleting EC2 security group `{0}' ID `{1}'...".format(
self.security_group_name, self.security_group_id))
self._connect()
self._conn.delete_security_group(group_id=self.security_group_id)
try:
self._conn.delete_security_group(group_id=self.security_group_id)
except boto.exception.EC2ResponseError as e:
if e.error_code != u'InvalidGroup.NotFound':
raise

self.state = self.MISSING
return True

0 comments on commit 04ab6c5

Please sign in to comment.