diff --git a/IM/connectors/OpenStack.py b/IM/connectors/OpenStack.py index 9565478b..e84b67a0 100644 --- a/IM/connectors/OpenStack.py +++ b/IM/connectors/OpenStack.py @@ -1023,7 +1023,7 @@ def delete_networks(self, driver, inf): driver.ex_delete_network(ost_net) if router and router.name == "im-%s" % inf.id: - driver.ex_delete_router(router.name) + driver.ex_delete_router(router) return res, msg @@ -2106,13 +2106,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))