diff options
| author | Dmitry Tantsur <divius.inside@gmail.com> | 2019-05-16 16:52:36 +0200 |
|---|---|---|
| committer | Dmitry Tantsur <divius.inside@gmail.com> | 2019-05-17 09:39:43 +0200 |
| commit | 266a700534cbd166c800999dd92556cb431d2055 (patch) | |
| tree | 7dfd31f286a5e5ccfae62e8528368c2240960711 /ironicclient/tests/unit | |
| parent | 7217d7e8dc780002a7053d6c678dbe39665581fd (diff) | |
| download | python-ironicclient-2.7.2.tar.gz | |
Do not try to use /v1/v1 when endpoint_override is used2.7.2
In one of the places where endpoint_override is used we did not strip
the /v1 suffix, resulting in doube /v1/v1 sometimes.
This patch also corrects the way we strip this suffix (str.rstrip accepts
a set of symbols, not a substring; use regex instead).
It remains unclear why the breakage passed the gate initially. I assume
it was not on the active code path until some Nova change.
Story: #2005723
Task: #31051
Change-Id: I3b25f4fb170aa93159ffa8074dc74fa6f50671b7
(cherry picked from commit 4565af8ccd8aaa35868fae6ae31216c3e57014f3)
Diffstat (limited to 'ironicclient/tests/unit')
| -rw-r--r-- | ironicclient/tests/unit/test_client.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ironicclient/tests/unit/test_client.py b/ironicclient/tests/unit/test_client.py index 20f68a2..5238fb6 100644 --- a/ironicclient/tests/unit/test_client.py +++ b/ironicclient/tests/unit/test_client.py @@ -93,14 +93,14 @@ class ClientTest(utils.BaseTestCase): client = self._test_get_client(auth='none', warn_mock_call_count=1, **kwargs) self.assertIsInstance(client.http_client, http.SessionClient) - self.assertEqual('http://localhost:6385/v1', + self.assertEqual('http://localhost:6385', client.http_client.endpoint_override) def test_get_client_only_endpoint(self): kwargs = {'endpoint': 'http://localhost:6385/v1'} client = self._test_get_client(auth='none', **kwargs) self.assertIsInstance(client.http_client, http.SessionClient) - self.assertEqual('http://localhost:6385/v1', + self.assertEqual('http://localhost:6385', client.http_client.endpoint_override) def test_get_client_with_auth_token_ironic_url(self): @@ -113,7 +113,7 @@ class ClientTest(utils.BaseTestCase): warn_mock_call_count=2, **kwargs) self.assertIsInstance(client.http_client, http.SessionClient) - self.assertEqual('http://localhost:6385/v1', + self.assertEqual('http://localhost:6385', client.http_client.endpoint_override) def test_get_client_no_auth_token(self): |
