Merge "Do not use service catalog for cache client"

This commit is contained in:
Jenkins 2016-11-11 21:24:35 +00:00 committed by Gerrit Code Review
commit e97b9f611c
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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',