From 5c52d1b848b2f8fa74072fe4634b9e8ff974fbdb Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Mon, 5 Sep 2016 00:18:51 -0700 Subject: [PATCH] L3: Only send notifications if l3 plugin exists Validate that the plugin exists to invoke notifications Conflicts: neutron/db/l3_db.py (cherry picked from commit 6566fb1a373a564e1549184711b0938f4995b33f) Change-Id: Iab970ca633b338e021b2c910281672b2350939c4 Closes-bug: #1618728 --- neutron/db/l3_db.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/neutron/db/l3_db.py b/neutron/db/l3_db.py index da7f3b68628..9d2b48c45ae 100644 --- a/neutron/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -1925,7 +1925,10 @@ def _notify_routers_callback(resource, event, trigger, **kwargs): router_ids = kwargs['router_ids'] l3plugin = manager.NeutronManager.get_service_plugins().get( constants.L3_ROUTER_NAT) - l3plugin.notify_routers_updated(context, router_ids) + if l3plugin: + l3plugin.notify_routers_updated(context, router_ids) + else: + LOG.debug('%s not configured', constants.L3_ROUTER_NAT) def _notify_subnet_gateway_ip_update(resource, event, trigger, **kwargs): @@ -1964,7 +1967,10 @@ def _notify_subnetpool_address_scope_update(resource, event, router_ids = [r[0] for r in query] l3plugin = manager.NeutronManager.get_service_plugins().get( constants.L3_ROUTER_NAT) - l3plugin.notify_routers_updated(context, router_ids) + if l3plugin: + l3plugin.notify_routers_updated(context, router_ids) + else: + LOG.debug('%s not configured', constants.L3_ROUTER_NAT) @removals.remove(