From 217fb605342b82f86af5a2e981b8b94f60e7a37c Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Thu, 20 Jun 2024 10:55:41 +0200 Subject: [PATCH] Fix error deleting IPs --- IM/connectors/OpenStack.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/IM/connectors/OpenStack.py b/IM/connectors/OpenStack.py index e375e4ca..c847e935 100644 --- a/IM/connectors/OpenStack.py +++ b/IM/connectors/OpenStack.py @@ -2109,13 +2109,13 @@ def delete_elastic_ips(self, node, vm): except Exception as ex: self.log_warn("Error detaching Floating IP: %s. %s" % (floating_ip.ip_address, get_ex_error(ex))) - # if it is in the list do not release it - if floating_ip.ip_address in no_delete_ips: - self.log_debug("Do not remove Floating IP: %s" % floating_ip.ip_address) - else: - self.log_debug("Remove Floating IP: %s" % floating_ip.ip_address) - # delete the ip - floating_ip.delete() + # if it is in the list do not release it + if floating_ip.ip_address in no_delete_ips: + self.log_debug("Do not remove Floating IP: %s" % floating_ip.ip_address) + else: + self.log_debug("Remove Floating IP: %s" % floating_ip.ip_address) + # delete the ip + floating_ip.delete() return True, "" except Exception as ex: self.log_exception("Error removing Floating IPs to VM ID: " + str(vm.id))