fix bug where nova ignores glance host in imageref
This is related to bug 883328. Change-Id: Iadd1aec8d1bda3bd75bd0ab7f6797b643626db90
This commit is contained in:
parent
7ac5fbcc30
commit
c7532c62ea
@ -111,13 +111,13 @@ def get_glance_client(context, image_href):
|
||||
|
||||
else:
|
||||
try:
|
||||
(image_id, host, port) = _parse_image_ref(image_href)
|
||||
(image_id, glance_host, glance_port) = _parse_image_ref(image_href)
|
||||
glance_client = _create_glance_client(context,
|
||||
glance_host,
|
||||
glance_port)
|
||||
except ValueError:
|
||||
raise exception.InvalidImageRef(image_href=image_href)
|
||||
|
||||
glance_client = _create_glance_client(context,
|
||||
glance_host,
|
||||
glance_port)
|
||||
return (glance_client, image_id)
|
||||
|
||||
|
||||
|
@ -578,6 +578,7 @@ class TestGlanceImageService(test.TestCase):
|
||||
def test_glance_client_image_ref(self):
|
||||
fixture = self._make_fixture(name='test image')
|
||||
image_id = self.service.create(self.context, fixture)['id']
|
||||
image_url = 'http://foo/%s' % image_id
|
||||
image_url = 'http://something-less-likely/%s' % image_id
|
||||
client, same_id = glance.get_glance_client(self.context, image_url)
|
||||
self.assertEquals(same_id, image_id)
|
||||
self.assertEquals(client.host, 'something-less-likely')
|
||||
|
Loading…
x
Reference in New Issue
Block a user