From: Kanzhe Jiang Date: Fri, 28 Jun 2013 21:23:46 +0000 (-0700) Subject: Support a timeout argument when instantiating a bigswitch plugin X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bc4c382f115c50fae1e00a64ec12869a29e34460;p=openstack-build%2Fneutron-build.git Support a timeout argument when instantiating a bigswitch plugin 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 --- diff --git a/quantum/plugins/bigswitch/plugin.py b/quantum/plugins/bigswitch/plugin.py index e2e9f83d9..b9a6335e3 100644 --- a/quantum/plugins/bigswitch/plugin.py +++ b/quantum/plugins/bigswitch/plugin.py @@ -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'