Browse Source

fix elastx cleanup security groups (#11411)

pull/11542/head
Kay Yan 2 months ago
committed by GitHub
parent
commit
e5d2452828
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 11 deletions
  1. 22
      scripts/openstack-cleanup/main.py

22
scripts/openstack-cleanup/main.py

@ -37,17 +37,6 @@ def main():
map_if_old(conn.compute.delete_server, map_if_old(conn.compute.delete_server,
conn.compute.servers()) 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...') print('Ports...')
try: try:
map_if_old(conn.network.delete_port, map_if_old(conn.network.delete_port,
@ -73,6 +62,17 @@ def main():
map_if_old(conn.network.delete_port, map_if_old(conn.network.delete_port,
conn.network.ports()) 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...') print('Subnets...')
map_if_old(conn.network.delete_subnet, map_if_old(conn.network.delete_subnet,
conn.network.subnets()) conn.network.subnets())

Loading…
Cancel
Save