Merge "NSX-v3 HTTP retries conf property"
This commit is contained in:
commit
1ca9a37e11
@ -341,7 +341,7 @@
|
||||
# Default Edge Cluster Identifier
|
||||
# default_edge_cluster_uuid = afc40f8a-4967-477e-a17a-9d560d1786c7
|
||||
|
||||
# Maximum number of times to retry API requests
|
||||
# Maximum number of times to retry API requests upon stale revision errors.
|
||||
# retries = 10
|
||||
|
||||
# Specify a CA bundle file to use in verifying the NSX Manager
|
||||
@ -361,6 +361,9 @@
|
||||
# The time in seconds before aborting a HTTP read response from a NSX manager.
|
||||
# http_read_timeout = 180
|
||||
|
||||
# Maximum number of times to retry a HTTP connection.
|
||||
# http_retries = 3
|
||||
|
||||
# Maxiumum number of connection connections to each NSX manager.
|
||||
# concurrent_connections = 10
|
||||
|
||||
|
@ -203,7 +203,8 @@ nsx_v3_opts = [
|
||||
"gateway service plugin.")),
|
||||
cfg.IntOpt('retries',
|
||||
default=10,
|
||||
help=_('Maximum number of times to retry API request')),
|
||||
help=_('Maximum number of times to retry API requests upon '
|
||||
'stale revision errors.')),
|
||||
cfg.StrOpt('ca_file',
|
||||
help=_('Specify a CA bundle file to use in verifying the NSX '
|
||||
'Manager server certificate. This option is ignored if '
|
||||
@ -224,6 +225,9 @@ nsx_v3_opts = [
|
||||
default=180,
|
||||
help=_('The time in seconds before aborting a HTTP read '
|
||||
'response from a NSX manager.')),
|
||||
cfg.IntOpt('http_retries',
|
||||
default=3,
|
||||
help=_('Maximum number of times to retry a HTTP connection.')),
|
||||
cfg.IntOpt('concurrent_connections', default=10,
|
||||
help=_("Maximum concurrent connections to each NSX "
|
||||
"manager.")),
|
||||
|
@ -437,7 +437,7 @@ class NSXClusteredAPI(ClusteredAPI):
|
||||
http_provider=None):
|
||||
self.username = username or cfg.CONF.nsx_v3.nsx_api_user
|
||||
self.password = password or cfg.CONF.nsx_v3.nsx_api_password
|
||||
self.retries = retries or cfg.CONF.nsx_v3.retries
|
||||
self.retries = retries or cfg.CONF.nsx_v3.http_retries
|
||||
self.insecure = insecure or cfg.CONF.nsx_v3.insecure
|
||||
self.ca_file = ca_file or cfg.CONF.nsx_v3.ca_file
|
||||
self.conns_per_pool = (concurrent_connections or
|
||||
|
@ -111,6 +111,15 @@ class NsxV3ClusteredAPITestCase(nsxlib_testcase.NsxClientTestCase):
|
||||
self._assert_providers(
|
||||
api, [(urlparse.urlparse(p).netloc, p) for p in conf_managers])
|
||||
|
||||
def test_http_retries(self):
|
||||
cfg.CONF.set_override(
|
||||
'http_retries', 9, 'nsx_v3')
|
||||
|
||||
api = self.mock_nsx_clustered_api()
|
||||
with api.endpoints['1.2.3.4'].pool.item() as session:
|
||||
self.assertEqual(
|
||||
session.adapters['https://'].max_retries.total, 9)
|
||||
|
||||
def test_conns_per_pool(self):
|
||||
cfg.CONF.set_override(
|
||||
'concurrent_connections', 11, 'nsx_v3')
|
||||
|
Loading…
Reference in New Issue
Block a user