]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove the useless l3plugin check in l3_rpc.py
authorHong Hui Xiao <xiaohhui@cn.ibm.com>
Sun, 15 Nov 2015 13:49:13 +0000 (08:49 -0500)
committerHong Hui Xiao <xiaohhui@cn.ibm.com>
Sun, 15 Nov 2015 13:49:13 +0000 (08:49 -0500)
Without "L3_ROUTER_NAT" in neutron's service_plugins, l3_rpc will
fail when getting l3plugin. So, remove the useless "if" block
here.

Change-Id: I56f417e5723ed40c70a186394de0bfcff696e469
Closes-Bug: #1514144

neutron/api/rpc/handlers/l3_rpc.py

index 9727e00f47604c5851f188a9c89f4c6ac2b35e8a..ac87c3d71583fe7defe2353533626a567cd2811f 100644 (file)
@@ -26,7 +26,6 @@ from neutron import context as neutron_context
 from neutron.db import api as db_api
 from neutron.extensions import l3
 from neutron.extensions import portbindings
-from neutron.i18n import _LE
 from neutron import manager
 from neutron.plugins.common import constants as plugin_constants
 
@@ -73,12 +72,8 @@ class L3RpcCallback(object):
         router_ids = kwargs.get('router_ids')
         host = kwargs.get('host')
         context = neutron_context.get_admin_context()
-        if not self.l3plugin:
-            routers = {}
-            LOG.error(_LE('No plugin for L3 routing registered! Will reply '
-                          'to l3 agent with empty router dictionary.'))
-        elif utils.is_extension_supported(
-                self.l3plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS):
+        if utils.is_extension_supported(
+            self.l3plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS):
             if cfg.CONF.router_auto_schedule:
                 self.l3plugin.auto_schedule_routers(context, host, router_ids)
             routers = (