From 0069d21d80e35491e87694ca3de8624da6e46a54 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Fri, 13 Dec 2024 15:39:51 -0600 Subject: [PATCH] add more hooks in the router plugin --- .../l3_service_cisco_asa.py | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/python/neutron-understack/neutron_understack/l3_service_cisco_asa.py b/python/neutron-understack/neutron_understack/l3_service_cisco_asa.py index 6d24656f..b7fd25cb 100644 --- a/python/neutron-understack/neutron_understack/l3_service_cisco_asa.py +++ b/python/neutron-understack/neutron_understack/l3_service_cisco_asa.py @@ -6,7 +6,7 @@ import requests import urllib3 from neutron.services.l3_router.service_providers import base -from neutron_lib.callbacks import registry +from neutron_lib.callbacks import events, registry, resources from oslo_log import log as logging LOG = logging.getLogger(__name__) @@ -42,3 +42,32 @@ def get_legacy_session(): @registry.has_registry_receivers class CiscoAsa(base.L3ServiceProvider): use_integrated_agent_scheduler = True + + @registry.receives(resources.ROUTER_INTERFACE, [events.AFTER_CREATE]) + def _process_router_interface_create(self, resource, event, trigger, payload): + router = payload.states[0] + context = payload.context + port = payload.metadata["port"] + subnets = payload.metadata["subnets"] + LOG.debug( + "router_interface_create1 %s / %s / %s / %s", router, context, port, subnets + ) + LOG.debug( + "router_interface_create2 %s / %s / %s / %s", + resource, + event, + trigger, + payload, + ) + + @registry.receives(resources.FLOATING_IP, [events.AFTER_CREATE]) + def _process_floatingip_create(self, resource, event, trigger, payload): + LOG.debug( + "floatingip_create %s / %s / %s / %s", resource, event, trigger, payload + ) + + @registry.receives(resources.FLOATING_IP, [events.AFTER_UPDATE]) + def _process_floatingip_update(self, resource, event, trigger, payload): + LOG.debug( + "floatingip_update %s / %s / %s / %s", resource, event, trigger, payload + )