Skip to content

Commit

Permalink
Making link prefixes support https.
Browse files Browse the repository at this point in the history
bug: 924090
Change-Id: Ie474b6c4412c8621e538ddfba0f2cef4d681c2a5
  • Loading branch information
ironcamel committed Feb 23, 2012
1 parent 939f082 commit 2d2ebd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nova/api/openstack/common.py
Expand Up @@ -488,5 +488,5 @@ def _update_link_prefix(self, orig_url, prefix):
return orig_url
url_parts = list(urlparse.urlsplit(orig_url))
prefix_parts = list(urlparse.urlsplit(prefix))
url_parts[1] = prefix_parts[1]
url_parts[0:2] = prefix_parts[0:2]
return urlparse.urlunsplit(url_parts)
6 changes: 3 additions & 3 deletions nova/tests/api/openstack/compute/test_images.py
Expand Up @@ -122,12 +122,12 @@ def test_get_image(self):
self.assertDictMatch(expected_image, actual_image)

def test_get_image_with_custom_prefix(self):
self.flags(osapi_compute_link_prefix='http://zoo.com:42',
self.flags(osapi_compute_link_prefix='https://zoo.com:42',
osapi_glance_link_prefix='http://circus.com:34')
fake_req = fakes.HTTPRequest.blank('/v2/fake/images/123')
actual_image = self.controller.show(fake_req, '124')
href = "http://zoo.com:42/v2/fake/images/124"
bookmark = "http://zoo.com:42/fake/images/124"
href = "https://zoo.com:42/v2/fake/images/124"
bookmark = "https://zoo.com:42/fake/images/124"
alternate = "http://circus.com:34/fake/images/124"
server_uuid = "aa640691-d1a7-4a67-9d3c-d35ee6b3cc74"
server_href = "http://localhost/v2/servers/" + server_uuid
Expand Down

0 comments on commit 2d2ebd6

Please sign in to comment.