diff -Nru glance-2012.1~e1~20111001.1037/debian/changelog glance-2012.1~e1~20111006.1039/debian/changelog --- glance-2012.1~e1~20111001.1037/debian/changelog 2011-10-01 18:02:07.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/debian/changelog 2011-10-06 13:31:55.000000000 +0000 @@ -1,8 +1,8 @@ -glance (2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1) natty; urgency=low +glance (2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1) natty; urgency=low * Automated PPA build. Packaging revision: 68. - -- Soren Hansen Sat, 01 Oct 2011 18:02:07 +0000 + -- Soren Hansen Thu, 06 Oct 2011 13:31:55 +0000 glance (2012.1~e1~20110919.1021-0ubuntu0) oneiric; urgency=low diff -Nru glance-2012.1~e1~20111001.1037/debian/patches/debian-changes-2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 glance-2012.1~e1~20111006.1039/debian/patches/debian-changes-2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 --- glance-2012.1~e1~20111001.1037/debian/patches/debian-changes-2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 2011-10-01 18:02:10.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/debian/patches/debian-changes-2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -Description: Upstream changes introduced in version 2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - glance (2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1) natty; urgency=low - . - * Automated PPA build. Packaging revision: 68. - . - The person named in the Author field signed this changelog entry. -Author: Soren Hansen - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: - ---- /dev/null -+++ glance-2012.1~e1~20111001.1037/.bzr-builddeb/default.conf -@@ -0,0 +1,2 @@ -+[BUILDDEB] -+merge = True diff -Nru glance-2012.1~e1~20111001.1037/debian/patches/debian-changes-2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 glance-2012.1~e1~20111006.1039/debian/patches/debian-changes-2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 --- glance-2012.1~e1~20111001.1037/debian/patches/debian-changes-2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 1970-01-01 00:00:00.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/debian/patches/debian-changes-2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 2011-10-06 13:31:57.000000000 +0000 @@ -0,0 +1,30 @@ +Description: Upstream changes introduced in version 2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + glance (2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1) natty; urgency=low + . + * Automated PPA build. Packaging revision: 68. + . + The person named in the Author field signed this changelog entry. +Author: Soren Hansen + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ glance-2012.1~e1~20111006.1039/.bzr-builddeb/default.conf +@@ -0,0 +1,2 @@ ++[BUILDDEB] ++merge = True diff -Nru glance-2012.1~e1~20111001.1037/debian/patches/series glance-2012.1~e1~20111006.1039/debian/patches/series --- glance-2012.1~e1~20111001.1037/debian/patches/series 2011-10-01 18:02:10.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/debian/patches/series 2011-10-06 13:31:57.000000000 +0000 @@ -1,2 +1,2 @@ sql_conn.patch -debian-changes-2012.1~e1~20111001.1037-0ubuntu0ppa1~natty1 +debian-changes-2012.1~e1~20111006.1039-0ubuntu0ppa1~natty1 diff -Nru glance-2012.1~e1~20111001.1037/glance/api/v1/images.py glance-2012.1~e1~20111006.1039/glance/api/v1/images.py --- glance-2012.1~e1~20111001.1037/glance/api/v1/images.py 2011-10-01 18:01:05.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/glance/api/v1/images.py 2011-10-06 13:31:20.000000000 +0000 @@ -192,8 +192,10 @@ :raises HTTPNotFound if image metadata is not available to user """ + image_meta = self.get_image_meta_or_404(req, id) + del image_meta['location'] return { - 'image_meta': self.get_image_meta_or_404(req, id), + 'image_meta': image_meta } def show(self, req, id): @@ -269,6 +271,7 @@ " from store"), id) image_iterator = get_from_store(image) + del image['location'] return { 'image_iterator': image_iterator, 'image_meta': image, diff -Nru glance-2012.1~e1~20111001.1037/glance/tests/functional/test_swift.py glance-2012.1~e1~20111006.1039/glance/tests/functional/test_swift.py --- glance-2012.1~e1~20111001.1037/glance/tests/functional/test_swift.py 2011-10-01 18:01:05.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/glance/tests/functional/test_swift.py 2011-10-06 13:31:20.000000000 +0000 @@ -44,6 +44,7 @@ from glance.tests.functional import test_api from glance.tests.utils import execute, skip_if_disabled +FIVE_KB = 5 * 1024 FIVE_MB = 5 * 1024 * 1024 @@ -399,7 +400,7 @@ registry_port = self.registry_port # POST /images with public image named Image1 - image_data = "*" * FIVE_MB + image_data = "*" * FIVE_KB headers = {'Content-Type': 'application/octet-stream', 'X-Image-Meta-Name': 'Image1', 'X-Image-Meta-Is-Public': 'True'} @@ -411,7 +412,7 @@ data = json.loads(content) self.assertEqual(data['image']['checksum'], hashlib.md5(image_data).hexdigest()) - self.assertEqual(data['image']['size'], FIVE_MB) + self.assertEqual(data['image']['size'], FIVE_KB) self.assertEqual(data['image']['name'], "Image1") self.assertEqual(data['image']['is_public'], True) @@ -420,20 +421,24 @@ http = httplib2.Http() response, content = http.request(path, 'GET') self.assertEqual(response.status, 200) - self.assertEqual(response['content-length'], str(FIVE_MB)) + self.assertEqual(response['content-length'], str(FIVE_KB)) - self.assertEqual(content, "*" * FIVE_MB) + self.assertEqual(content, "*" * FIVE_KB) self.assertEqual(hashlib.md5(content).hexdigest(), - hashlib.md5("*" * FIVE_MB).hexdigest()) + hashlib.md5("*" * FIVE_KB).hexdigest()) - # GET /images/1 from registry in order to find Swift location + # Find the location that was just added and use it as + # the remote image location for the next image path = "http://%s:%d/images/1" % ("0.0.0.0", self.registry_port) http = httplib2.Http() response, content = http.request(path, 'GET') - swift_location = json.loads(content)['image']['location'] + self.assertEqual(response.status, 200) + data = json.loads(content) + self.assertTrue('location' in data['image'].keys()) + swift_location = data['image']['location'] # POST /images with public image named Image1 without uploading data - image_data = "*" * FIVE_MB + image_data = "*" * FIVE_KB headers = {'Content-Type': 'application/octet-stream', 'X-Image-Meta-Name': 'Image1', 'X-Image-Meta-Is-Public': 'True', @@ -453,11 +458,11 @@ http = httplib2.Http() response, content = http.request(path, 'GET') self.assertEqual(response.status, 200) - self.assertEqual(response['content-length'], str(FIVE_MB)) + self.assertEqual(response['content-length'], str(FIVE_KB)) - self.assertEqual(content, "*" * FIVE_MB) + self.assertEqual(content, "*" * FIVE_KB) self.assertEqual(hashlib.md5(content).hexdigest(), - hashlib.md5("*" * FIVE_MB).hexdigest()) + hashlib.md5("*" * FIVE_KB).hexdigest()) # DELETE /images/1 and /image/2 # Verify image and all chunks are gone... diff -Nru glance-2012.1~e1~20111001.1037/glance/tests/unit/test_api.py glance-2012.1~e1~20111006.1039/glance/tests/unit/test_api.py --- glance-2012.1~e1~20111001.1037/glance/tests/unit/test_api.py 2011-10-01 18:01:05.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/glance/tests/unit/test_api.py 2011-10-06 13:31:20.000000000 +0000 @@ -2163,6 +2163,36 @@ res = req.get_response(self.api) self.assertEquals(res.status_int, 400) + def test_store_location_not_revealed(self): + """ + Test that the internal store location is NOT revealed + through the API server + """ + # Check index and details... + for url in ('/images', '/images/detail'): + req = webob.Request.blank(url) + res = req.get_response(self.api) + self.assertEquals(res.status_int, 200) + res_dict = json.loads(res.body) + + images = res_dict['images'] + num_locations = sum([1 for record in images + if 'location' in record.keys()]) + self.assertEquals(0, num_locations, images) + + # Check GET + req = webob.Request.blank("/images/2") + res = req.get_response(self.api) + self.assertEqual(res.status_int, 200) + self.assertFalse('X-Image-Meta-Location' in res.headers) + + # Check HEAD + req = webob.Request.blank("/images/2") + req.method = 'HEAD' + res = req.get_response(self.api) + self.assertEqual(res.status_int, 200) + self.assertFalse('X-Image-Meta-Location' in res.headers) + def test_image_is_checksummed(self): """Test that the image contents are checksummed properly""" fixture_headers = {'x-image-meta-store': 'file', diff -Nru glance-2012.1~e1~20111001.1037/glance/tests/unit/test_clients.py glance-2012.1~e1~20111006.1039/glance/tests/unit/test_clients.py --- glance-2012.1~e1~20111001.1037/glance/tests/unit/test_clients.py 2011-10-01 18:01:05.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/glance/tests/unit/test_clients.py 2011-10-06 13:31:20.000000000 +0000 @@ -1543,6 +1543,7 @@ # Test all other attributes set data = self.client.get_image_meta(3) + del fixture['location'] for k, v in fixture.items(): self.assertEquals(v, data[k]) @@ -1581,6 +1582,7 @@ # Test all other attributes set data = self.client.get_image_meta(3) + del fixture['location'] for k, v in fixture.items(): self.assertEquals(v, data[k]) @@ -1607,6 +1609,7 @@ # Test all other attributes set data = self.client.get_image_meta(3) + del fixture['location'] for k, v in fixture.items(): self.assertEquals(v, data[k]) @@ -1633,6 +1636,7 @@ # Test all other attributes set data = self.client.get_image_meta(3) + del fixture['location'] for k, v in fixture.items(): self.assertEquals(v, data[k]) diff -Nru glance-2012.1~e1~20111001.1037/glance/vcsversion.py glance-2012.1~e1~20111006.1039/glance/vcsversion.py --- glance-2012.1~e1~20111001.1037/glance/vcsversion.py 2011-10-01 18:01:06.000000000 +0000 +++ glance-2012.1~e1~20111006.1039/glance/vcsversion.py 2011-10-06 13:31:23.000000000 +0000 @@ -2,6 +2,6 @@ # This file is automatically generated by setup.py, So don't edit it. :) version_info = { 'branch_nick': '(no', - 'revision_id': 'fe1f1650a25acb3cf0a5654e32326d6a2fb02e22', - 'revno': 1037 + 'revision_id': 'a9150768884670fb8b15fd295d7a544e8b0127da', + 'revno': 1039 }