Add configurable http_timeout parameter for Cisco N1K
http_timeout is a constant defined in the code. This change makes it
configurable by providing it as an option in the config file.
DocImpact
Conflicts:
etc/neutron/plugins/cisco/cisco_plugins.ini
neutron/plugins/cisco/common/config.py
Closes-Bug: #1332290
Change-Id: I429dd9efa43f6a596933359f4627a7761411e621
(cherry picked from commit a8d67485ab
)
This commit is contained in:
parent
543e3ac99e
commit
2c762bec3b
|
@ -132,3 +132,8 @@
|
|||
#
|
||||
# poll_duration =
|
||||
# Example: poll_duration = 180
|
||||
|
||||
# (IntOpt) Timeout duration in seconds for the http request
|
||||
#
|
||||
# http_timeout =
|
||||
# Example: http_timeout = 15
|
||||
|
|
|
@ -83,7 +83,6 @@ NETWORK_SUBTYPE_TRUNK_VXLAN = NETWORK_TYPE_OVERLAY
|
|||
# Prefix for VM Network name
|
||||
VM_NETWORK_NAME_PREFIX = 'vmn_'
|
||||
|
||||
DEFAULT_HTTP_TIMEOUT = 15
|
||||
SET = 'set'
|
||||
INSTANCE = 'instance'
|
||||
PROPERTIES = 'properties'
|
||||
|
|
|
@ -80,6 +80,8 @@ cisco_n1k_opts = [
|
|||
help=_("N1K policy profile for network node")),
|
||||
cfg.StrOpt('poll_duration', default='10',
|
||||
help=_("N1K Policy profile polling duration in seconds")),
|
||||
cfg.IntOpt('http_timeout', default=15,
|
||||
help=_("N1K http timeout duration in seconds")),
|
||||
]
|
||||
|
||||
cfg.CONF.register_opts(cisco_opts, "CISCO")
|
||||
|
|
|
@ -27,6 +27,7 @@ from neutron.openstack.common import log as logging
|
|||
from neutron.plugins.cisco.common import cisco_constants as c_const
|
||||
from neutron.plugins.cisco.common import cisco_credentials_v2 as c_cred
|
||||
from neutron.plugins.cisco.common import cisco_exceptions as c_exc
|
||||
from neutron.plugins.cisco.common import config as c_conf
|
||||
from neutron.plugins.cisco.db import network_db_v2
|
||||
from neutron.plugins.cisco.extensions import n1kv
|
||||
from neutron import wsgi
|
||||
|
@ -146,7 +147,7 @@ class Client(object):
|
|||
self.format = 'json'
|
||||
self.hosts = self._get_vsm_hosts()
|
||||
self.action_prefix = 'http://%s/api/n1k' % self.hosts[0]
|
||||
self.timeout = c_const.DEFAULT_HTTP_TIMEOUT
|
||||
self.timeout = c_conf.CISCO_N1K.http_timeout
|
||||
|
||||
def list_port_profiles(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue