Skip to content

Commit

Permalink
add more hooks in the router plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cardoe committed Dec 13, 2024
1 parent bebf05a commit 0069d21
Showing 1 changed file with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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
)

0 comments on commit 0069d21

Please sign in to comment.