summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-17 02:10:18 +0000
committerGerrit Code Review <review@openstack.org>2017-02-17 02:10:18 +0000
commit6d2a08635f7c1b1bd7eb6050320e7128240b6a2d (patch)
tree7ba7799356a0c79b4cf3d389b726016245912896
parentef2f766ce0110da7b919ddd0b0f7720eceff8954 (diff)
parentd9e584bd4fd95cdb19b89d0edf591c13c10cd8d9 (diff)
downloadglance-newton-eol.tar.gz
Merge "Do not use service catalog for cache client" into stable/newtonnewton-eol
-rw-r--r--glance/image_cache/client.py3
-rw-r--r--glance/tests/unit/test_image_cache_client.py9
2 files changed, 11 insertions, 1 deletions
diff --git a/glance/image_cache/client.py b/glance/image_cache/client.py
index 3cf7bfaf6..22160152d 100644
--- a/glance/image_cache/client.py
+++ b/glance/image_cache/client.py
@@ -128,4 +128,5 @@ def get_client(host, port=None, timeout=None, use_ssl=False, username=None,
auth_token=auth_token or
os.getenv('OS_TOKEN'),
creds=creds,
- insecure=insecure)
+ insecure=insecure,
+ configure_via_auth=False)
diff --git a/glance/tests/unit/test_image_cache_client.py b/glance/tests/unit/test_image_cache_client.py
index 883200c8d..c3ea9db33 100644
--- a/glance/tests/unit/test_image_cache_client.py
+++ b/glance/tests/unit/test_image_cache_client.py
@@ -116,6 +116,15 @@ class GetClientTestCase(utils.BaseTestCase):
).creds
self.assertEqual(expected_creds, creds)
+ def test_get_client_using_provided_host(self):
+ cli = client.get_client(self.host)
+ cli._do_request = mock.MagicMock()
+ cli.configure_from_url = mock.MagicMock()
+ cli.auth_plugin.management_url = mock.MagicMock()
+ cli.do_request("GET", "/queued_images")
+ self.assertFalse(cli.configure_from_url.called)
+ self.assertFalse(client.get_client(self.host).configure_via_auth)
+
def test_get_client_client_configuration_error(self):
self.assertRaises(exception.ClientConfigurationError,
client.get_client, self.host, username='name',