summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/api
diff options
context:
space:
mode:
authorImtiaz Chowdhury <imtiaz.chowdhury@workday.com>2016-12-27 14:04:29 -0800
committerSteve Martinelli <s.martinelli@gmail.com>2017-01-04 18:14:10 +0000
commit1bd2bf67dab86bce06da89db65f2b532edf8e35e (patch)
tree07331298b8f0839054df5696426f3497f4f0600e /openstackclient/tests/unit/api
parente6e3cd295ceadadaf7e85a719dc9545157c16e41 (diff)
downloadpython-openstackclient-1bd2bf67dab86bce06da89db65f2b532edf8e35e.tar.gz
Fixes image api URL endpoint for certain scenario
openstackclient fails to get image list when the image api endpoint has 'v2' substring in the URL. Instead of checking whether the api endpoint URL terminates with '/v2', the current logic is checking whether 'v2' appears anywhere in the endpoint string. This issue was discovered on a production setup where certain server names had 'v2' in their names. For example, when a hostname is gopher.dev20.com, the image list APIs fail. This commit updates the unit test to reflect this scenario. Without the change in openstackclient/api/image_v2.py, all the unit tests fail. Co-Authored-By: sergio.carvalho@workday.com Change-Id: I26b85afd646938272dbabe8e045b337b7df58c7d Closes-Bug: 1652827
Diffstat (limited to 'openstackclient/tests/unit/api')
-rw-r--r--openstackclient/tests/unit/api/test_image_v1.py2
-rw-r--r--openstackclient/tests/unit/api/test_image_v2.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/openstackclient/tests/unit/api/test_image_v1.py b/openstackclient/tests/unit/api/test_image_v1.py
index e02ef381..6ce3ddea 100644
--- a/openstackclient/tests/unit/api/test_image_v1.py
+++ b/openstackclient/tests/unit/api/test_image_v1.py
@@ -21,7 +21,7 @@ from openstackclient.tests.unit import utils
FAKE_PROJECT = 'xyzpdq'
-FAKE_URL = 'http://gopher.com'
+FAKE_URL = 'http://gopher.dev10.com'
class TestImageAPIv1(utils.TestCase):
diff --git a/openstackclient/tests/unit/api/test_image_v2.py b/openstackclient/tests/unit/api/test_image_v2.py
index 5dbb51e0..22490e46 100644
--- a/openstackclient/tests/unit/api/test_image_v2.py
+++ b/openstackclient/tests/unit/api/test_image_v2.py
@@ -21,7 +21,7 @@ from openstackclient.tests.unit import utils
FAKE_PROJECT = 'xyzpdq'
-FAKE_URL = 'http://gopher.com'
+FAKE_URL = 'http://gopher.dev20.com'
class TestImageAPIv2(utils.TestCase):