diff options
| author | Naveed Massjouni <naveedm9@gmail.com> | 2012-02-23 17:53:14 +0000 |
|---|---|---|
| committer | Naveed Massjouni <naveedm9@gmail.com> | 2012-02-23 17:53:14 +0000 |
| commit | 2d2ebd676a81a0443824990a710eda4df72b9987 (patch) | |
| tree | 42fe8c18ae70f04e30139b1719692d3d965e53db | |
| parent | 939f082cc2fb0b71bb601f80e3ea95d0be355e4c (diff) | |
| download | nova-2d2ebd676a81a0443824990a710eda4df72b9987.tar.gz nova-2d2ebd676a81a0443824990a710eda4df72b9987.tar.xz nova-2d2ebd676a81a0443824990a710eda4df72b9987.zip | |
Making link prefixes support https.
bug: 924090
Change-Id: Ie474b6c4412c8621e538ddfba0f2cef4d681c2a5
| -rw-r--r-- | nova/api/openstack/common.py | 2 | ||||
| -rw-r--r-- | nova/tests/api/openstack/compute/test_images.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py index 575c58fac..92ef17687 100644 --- a/nova/api/openstack/common.py +++ b/nova/api/openstack/common.py @@ -488,5 +488,5 @@ class ViewBuilder(object): 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) diff --git a/nova/tests/api/openstack/compute/test_images.py b/nova/tests/api/openstack/compute/test_images.py index 460bf437f..660345031 100644 --- a/nova/tests/api/openstack/compute/test_images.py +++ b/nova/tests/api/openstack/compute/test_images.py @@ -122,12 +122,12 @@ class ImagesControllerTest(test.TestCase): 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 |
