Skip to content

Commit

Permalink
small fix when removing sec grouo from vm
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed May 23, 2024
1 parent bcbdd47 commit 8ffd9be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,12 @@ def _remove_security_groups_from_server(self, server: Server) -> None:
and not self.is_security_group_in_use(security_group_id=sec.id)
):
logger.info(f"Delete security group {sec}")

self.openstack_connection.delete_security_group(sec)
try:
self.openstack_connection.delete_security_group(sec)
except ResourceNotFound:
logger.info(
f"Could not remoeve security group {sec.id} from server"
)

def _validate_server_for_deletion(self, server: Server) -> None:
task_state = server.task_state
Expand Down

0 comments on commit 8ffd9be

Please sign in to comment.