From 8eed618dbb5bbc27ee0a49e712afbfcfeb4d8185 Mon Sep 17 00:00:00 2001 From: micafer Date: Tue, 21 Apr 2020 11:08:34 +0200 Subject: [PATCH] Improve log --- IM/connectors/EC2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IM/connectors/EC2.py b/IM/connectors/EC2.py index 0672589fd..fe32bea9d 100644 --- a/IM/connectors/EC2.py +++ b/IM/connectors/EC2.py @@ -1335,18 +1335,19 @@ def delete_networks(self, conn, vm, timeout=240): vpc_id = None for vpc in conn.get_all_vpcs(filters={"tag:IM-INFRA-ID": vm.inf.id}): - self.log_info("Deleting vpc: %s" % vpc.id) vpc_id = vpc.id ig_id = None for ig in conn.get_all_internet_gateways(filters={"tag:IM-INFRA-ID": vm.inf.id}): - self.log_info("Deleting Internet Gateway: %s" % ig.id) ig_id = ig.id if ig_id and vpc_id: + self.log_info("Detacching Internet Gateway: %s from VPC: %s" % (ig_id, vpc_id)) conn.detach_internet_gateway(ig_id, vpc_id) if ig_id: + self.log_info("Deleting Internet Gateway: %s" % ig.id) conn.delete_internet_gateway(ig_id) if vpc_id: + self.log_info("Deleting vpc: %s" % vpc.id) conn.delete_vpc(vpc_id) def finalize(self, vm, last, auth_data):