Skip to content

Commit

Permalink
Merge pull request #1585 from grycap/devel
Browse files Browse the repository at this point in the history
Fix deleting floating IPs
  • Loading branch information
micafer authored Jul 2, 2024
2 parents 3b45672 + 2995631 commit d6e586e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,8 +1609,9 @@ def add_elastic_ip_from_pool(self, vm, node, fixed_ip=None, pool_name=None):

if not attached:
self.log_error("Error attaching a Floating IP to the node.")
self.log_info("We have created it, so release it.")
floating_ip.delete()
if not found:
self.log_info("We have created it, so release it.")
floating_ip.delete()
return False, "Error attaching a Floating IP to the node."

if found:
Expand Down Expand Up @@ -1746,7 +1747,6 @@ def finalize(self, vm, last, auth_data):
try:
res, msg = self.delete_elastic_ips(node, vm)
except Exception as ex:
res = False
msg = get_ex_error(ex)
success.append(res)
msgs.append(msg)
Expand Down

0 comments on commit d6e586e

Please sign in to comment.