Skip to content

Commit

Permalink
play with floating ip update
Browse files Browse the repository at this point in the history
  • Loading branch information
cardoe committed Dec 17, 2024
1 parent 404a49d commit 60bd2b5
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ def _process_floatingip_create(self, resource, event, trigger, payload):

@registry.receives(resources.FLOATING_IP, [events.AFTER_UPDATE])
def _process_floatingip_update(self, resource, event, trigger, payload):
# read the state, state[0] is previous and state[1] is current
context = payload.context
fip = payload.states[1]
metadata = payload.metadata

# are we associating (True) or disassociating (False)
assoc_disassoc = payload.metadata["association_event"]
# what is the floating IP we are trying to use
float_ip_addr = fip["floating_ip_address"]
LOG.debug(
"floatingip_update %s / %s / %s / %s", resource, event, trigger, payload
"floatingip_update %s / %s / %s / %s",
assoc_disassoc,
metadata,
fip,
float_ip_addr,
)

if not fip["router_id"]:
return
router = self.l3plugin.get_router(context, fip["router_id"])
LOG.debug("floatingip_update router %s", router)

0 comments on commit 60bd2b5

Please sign in to comment.