]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Big Switch: Remove unnecessary initialization code
authorKevin Benton <blak111@gmail.com>
Thu, 12 Jun 2014 09:15:27 +0000 (02:15 -0700)
committerKevin Benton <blak111@gmail.com>
Thu, 12 Jun 2014 09:28:24 +0000 (02:28 -0700)
Removes a server_timeout parameter that was never set by anything
in the Big Switch plugin and the ML2 driver.

Also eliminates an __init__ method that didn't do anything except
incorrectly log an unset server pool warning before the inheriting
class setup the server pool.

Closes-Bug: #1331249
Change-Id: I77dd22295305b96d4702f1ea0e319dc5f82c71a8

neutron/plugins/bigswitch/plugin.py
neutron/plugins/ml2/drivers/mech_bigswitch/driver.py

index 6d25827c00a61e694fc190493a5d960eec1e4ffa..9249f5d6b0215d65ea15e47fe5ae7e37c3395721 100644 (file)
@@ -168,13 +168,6 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
     supported_extension_aliases = ["binding"]
     servers = None
 
-    def __init__(self, server_timeout=None):
-        super(NeutronRestProxyV2Base, self).__init__()
-        # This base class is not intended to be instantiated directly.
-        # Extending class should set ServerPool.
-        if not self.servers:
-            LOG.warning(_("ServerPool not set!"))
-
     def _get_all_data(self, get_ports=True, get_floating_ips=True,
                       get_routers=True):
         admin_context = qcontext.get_admin_context()
@@ -474,7 +467,7 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
             self._aliases = aliases
         return self._aliases
 
-    def __init__(self, server_timeout=None):
+    def __init__(self):
         super(NeutronRestProxyV2, self).__init__()
         LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                  version.version_string_with_vcs())
@@ -487,7 +480,7 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
         self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route
 
         # init network ctrl connections
-        self.servers = servermanager.ServerPool(server_timeout)
+        self.servers = servermanager.ServerPool()
         self.servers.get_topo_function = self._get_all_data
         self.servers.get_topo_function_args = {'get_ports': True,
                                                'get_floating_ips': True,
index b3acb6671d00f33ac4c16b76c5d10ae65d561fdc..faab0a26ff4314fe0f9237481a2d31c0418291bb 100644 (file)
@@ -43,7 +43,7 @@ class BigSwitchMechanismDriver(plugin.NeutronRestProxyV2Base,
     operations to the Big Switch Controller.
     """
 
-    def initialize(self, server_timeout=None):
+    def initialize(self):
         LOG.debug(_('Initializing driver'))
 
         # register plugin config opts
@@ -53,7 +53,7 @@ class BigSwitchMechanismDriver(plugin.NeutronRestProxyV2Base,
         self.native_bulk_support = False
 
         # init network ctrl connections
-        self.servers = servermanager.ServerPool(server_timeout)
+        self.servers = servermanager.ServerPool()
         self.servers.get_topo_function = self._get_all_data
         self.servers.get_topo_function_args = {'get_ports': True,
                                                'get_floating_ips': False,