From 0a1731f131c8838bc55e859711b64acea7185e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Raczy=C5=84ski?= Date: Mon, 25 Nov 2024 22:32:48 +0100 Subject: [PATCH] fix delete.py --- delete.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/delete.py b/delete.py index acfbf2a..16357f1 100644 --- a/delete.py +++ b/delete.py @@ -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}") \ No newline at end of file