fix delete.py

This commit is contained in:
Krzysztof Raczyński 2024-11-25 22:27:03 +01:00
parent bc3d43a82b
commit ff70ab99ca

View File

@ -11,13 +11,6 @@ for s in lbs:
action = client.load_balancers.delete(s)
print(f"\tUsuwanie LB {s.data_model.name}: {action}")
servers = client.servers.get_all()
print(f"Usuwanie {len(servers)} serwerów")
for s in servers:
if s.data_model.name.startswith(PREFIX):
action = client.servers.delete(s)
print(f"\tUsuwanie serwera {s.data_model.name} ({s.data_model.public_net.ipv4.ip}): {action.data_model.status}")
vnets = client.networks.get_all()
print(f"Usuwanie {len(vnets)} sieci wirtualnych")
@ -26,6 +19,7 @@ for s in vnets:
action = client.networks.delete(s)
print(f"\tUsuwanie sieci wirtualnej {s.name}: {action}")
volumes = client.volumes.get_all()
print(f"Usuwanie {len(volumes)} wolumenów")
for v in volumes:
@ -33,3 +27,10 @@ for v in volumes:
action = client.volumes.delete(v)
print(f"\tUsuwanie wolumenu {v.name}: {action}")
servers = client.servers.get_all()
print(f"Usuwanie {len(servers)} serwerów")
for s in servers:
if s.data_model.name.startswith(PREFIX):
action = client.servers.delete(s)
print(f"\tUsuwanie serwera {s.data_model.name} ({s.data_model.public_net.ipv4.ip}): {action.data_model.status}")