Merge "Add configurable http_timeout parameter for Cisco N1K"

This commit is contained in:
Jenkins 2014-07-02 18:14:42 +00:00 committed by Gerrit Code Review
commit 9f20c653c7
4 changed files with 8 additions and 2 deletions

View File

@ -136,3 +136,8 @@
# (IntOpt) Number of threads to use to make HTTP requests to the VSM.
#
# http_pool_size = 4
# (IntOpt) Timeout duration in seconds for the http request
#
# http_timeout =
# Example: http_timeout = 15

View File

@ -81,7 +81,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'

View File

@ -80,6 +80,8 @@ cisco_n1k_opts = [
help=_("N1K Policy profile polling duration in seconds")),
cfg.IntOpt('http_pool_size', default=4,
help=_("Number of threads to use to make HTTP requests")),
cfg.IntOpt('http_timeout', default=15,
help=_("N1K http timeout duration in seconds")),
]
cfg.CONF.register_opts(cisco_opts, "CISCO")

View File

@ -129,7 +129,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):
"""