]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Support a timeout argument when instantiating a bigswitch plugin
authorKanzhe Jiang <kanzhe@gmail.com>
Fri, 28 Jun 2013 21:23:46 +0000 (14:23 -0700)
committerKanzhe Jiang <kanzhe@gmail.com>
Fri, 28 Jun 2013 23:11:40 +0000 (16:11 -0700)
The timeout argument overwrites the timeout value set in the config file.
The change permits any standalone script to interact with the bigswitch controller
through the quantum plugin with customized timeout value without changing the plugin
behavior.

Fixes: bug #1195923
Change-Id: I17954e70d661e7e7d5156c34c08b7c96bb3203ce

quantum/plugins/bigswitch/plugin.py

index e2e9f83d9e103513e85e8e4d8e90cb76e9c569de..b9a6335e3714be314fe870cf4aeb991be607796e 100644 (file)
@@ -333,7 +333,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2,
 
     supported_extension_aliases = ["router", "binding", "router_rules"]
 
-    def __init__(self):
+    def __init__(self, server_timeout=None):
         LOG.info(_('QuantumRestProxy: Starting plugin. Version=%s'),
                  version_string_with_vcs())
 
@@ -347,9 +347,11 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2,
         server_auth = cfg.CONF.RESTPROXY.server_auth
         server_ssl = cfg.CONF.RESTPROXY.server_ssl
         sync_data = cfg.CONF.RESTPROXY.sync_data
-        timeout = cfg.CONF.RESTPROXY.server_timeout
         quantum_id = cfg.CONF.RESTPROXY.quantum_id
         self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route
+        timeout = cfg.CONF.RESTPROXY.server_timeout
+        if server_timeout is not None:
+            timeout = server_timeout
 
         # validate config
         assert servers is not None, 'Servers not defined. Aborting plugin'