Skip to content

Commit

Permalink
Fix error deleting IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jun 20, 2024
1 parent 286cac0 commit 217fb60
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 217fb60

Please sign in to comment.