summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2021-05-28 00:26:04 +0000
committermelanie witt <melwittt@gmail.com>2021-06-07 20:19:23 +0000
commitb96f93ed8633d6fd0725c4a11366ffbf38056e65 (patch)
tree51045b62b648649baf7fb786b0dfa72439d457b4
parentba6789e458f5da1e7b792866120128c609ca8537 (diff)
downloadnova-b96f93ed8633d6fd0725c4a11366ffbf38056e65.tar.gz
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 (cherry picked from commit 56eb253e9febccf721df6bca4eb851ad26cb70a6) (cherry picked from commit 46aa3f4ec769e948d9eb73604bf9b66f4b0230b0) (cherry picked from commit f20346bc00a30c914cbefb48009db776f8e00b09)
-rw-r--r--nova/network/neutron.py1
-rw-r--r--nova/tests/unit/network/test_neutron.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/nova/network/neutron.py b/nova/network/neutron.py
index 745d522f8c..4c882e7f96 100644
--- a/nova/network/neutron.py
+++ b/nova/network/neutron.py
@@ -273,6 +273,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
diff --git a/nova/tests/unit/network/test_neutron.py b/nova/tests/unit/network/test_neutron.py
index 3e6dc6417b..5d7c2069eb 100644
--- a/nova/tests/unit/network/test_neutron.py
+++ b/nova/tests/unit/network/test_neutron.py
@@ -253,6 +253,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):