Honor [neutron]http_retries in the manual client

Change Ifb3afb13aff7e103c2e80ade817d0e63b624604a added a nova side
config option for specifying neutron client retries that maps to the
ksa connect_retries config option to provide parity with the cinder and
glance clients that have nova side config options.

That change missed passing CONF.neutron.http_retries to the manual
client used for calling the port binding API. This sets the
connect_retries attribute on the manual ksa client so http_retries
will be honored.

Closes-Bug: #1929886
Related-Bug: #1866937

Change-Id: I8296e4be9f0706fab043451b856efadbb7bd41f6
This commit is contained in:
melanie witt 2021-05-28 00:26:04 +00:00
parent b0cd985f0c
commit 56eb253e9f
2 changed files with 3 additions and 0 deletions

View File

@ -271,6 +271,7 @@ def _get_ksa_client(context, admin=False):
client = utils.get_ksa_adapter(
'network', ksa_auth=auth_plugin, ksa_session=session)
client.additional_headers = {'accept': 'application/json'}
client.connect_retries = CONF.neutron.http_retries
return client

View File

@ -251,6 +251,8 @@ class TestNeutronClient(test.NoDBTestCase):
auth_token='token')
cl = neutronapi.get_client(my_context)
self.assertEqual(retries, cl.httpclient.connect_retries)
kcl = neutronapi._get_ksa_client(my_context)
self.assertEqual(retries, kcl.connect_retries)
class TestAPIBase(test.TestCase):