Consider --os-token when using v2

The `_cache_schemas` call currently forces authentication even when the
`auth_token` and `os_image_url` are passed. Instead of handling forced
authentications, let the client use the passed arguments and
authenticate only once if needed.

This was not caught by the existing tests because the call to
`_cache_schemas` was mocked.

Change-Id: I93cec9a68cafc0992d14dab38114d03e25f1e5da
Closes-bug: #1490462
This commit is contained in:
Flavio Percoco
2015-09-02 14:58:59 +02:00
parent 47423ebbb2
commit 1322fbc5d8
3 changed files with 40 additions and 32 deletions
@@ -103,7 +103,7 @@ class SimpleReadOnlyGlanceClientTest(base.ClientTestBase):
self.glance('', flags='--version')
def test_debug_list(self):
self.glance('image-list', flags='--debug')
self.glance('--os-image-api-version 2 image-list', flags='--debug')
def test_no_ssl_compression(self):
# Test deprecating this hasn't broken anything