Skip to content

Commit

Permalink
fix elastx cleanup security groups (kubernetes-sigs#11411)
Browse files Browse the repository at this point in the history
  • Loading branch information
yankay authored Sep 15, 2024
1 parent 8cb081a commit e5d2452
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/openstack-cleanup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ def main():
map_if_old(conn.compute.delete_server,
conn.compute.servers())

print('Security groups...')
try:
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())
except openstack.exceptions.ConflictException as ex:
# Need to delete port when security groups is in used
map_if_old(conn.network.delete_port,
conn.network.ports())
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())

print('Ports...')
try:
map_if_old(conn.network.delete_port,
Expand All @@ -73,6 +62,17 @@ def main():
map_if_old(conn.network.delete_port,
conn.network.ports())

print('Security groups...')
try:
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())
except openstack.exceptions.ConflictException as ex:
# Need to delete port when security groups is in used
map_if_old(conn.network.delete_port,
conn.network.ports())
map_if_old(conn.network.delete_security_group,
conn.network.security_groups())

print('Subnets...')
map_if_old(conn.network.delete_subnet,
conn.network.subnets())
Expand Down

0 comments on commit e5d2452

Please sign in to comment.