fix delete.py

This commit is contained in:
Krzysztof Raczyński 2024-11-25 22:32:48 +01:00
parent ff70ab99ca
commit 0a1731f131

View File

@ -12,6 +12,14 @@ for s in lbs:
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")
for s in vnets:
@ -28,9 +36,3 @@ for v in volumes:
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}")