Merge lp:~rackspace-titan/nova/checksum-property-lp800843 into lp:~hudson-openstack/nova/trunk

Proposed by Brian Waldon
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1203
Merged at revision: 1210
Proposed branch: lp:~rackspace-titan/nova/checksum-property-lp800843
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 52 lines (+8/-2)
2 files modified
nova/image/glance.py (+1/-1)
nova/tests/api/openstack/test_image_metadata.py (+7/-1)
To merge this branch: bzr merge lp:~rackspace-titan/nova/checksum-property-lp800843
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Alex Meade (community) Approve
Brian Lamar (community) Approve
Review via email: mp+65554@code.launchpad.net

Description of the change

- update glance image fixtures with expected checksum attribute
- ensure checksum attribute is handled properly in image service

To post a comment you must log in.
Revision history for this message
Brian Lamar (blamar) wrote :

Pretty straight forward fix, tests pass for me!

review: Approve
Revision history for this message
Alex Meade (alex-meade) wrote :

makes sense to me

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/image/glance.py'
2--- nova/image/glance.py 2011-06-09 21:50:34 +0000
3+++ nova/image/glance.py 2011-06-22 19:24:36 +0000
4@@ -59,7 +59,7 @@
5 """Provides storage and retrieval of disk image objects within Glance."""
6
7 GLANCE_ONLY_ATTRS = ['size', 'location', 'disk_format',
8- 'container_format']
9+ 'container_format', 'checksum']
10
11 # NOTE(sirp): Overriding to use _translate_to_service provided by
12 # BaseImageService
13
14=== modified file 'nova/tests/api/openstack/test_image_metadata.py'
15--- nova/tests/api/openstack/test_image_metadata.py 2011-04-18 20:49:06 +0000
16+++ nova/tests/api/openstack/test_image_metadata.py 2011-06-22 19:24:36 +0000
17@@ -37,6 +37,7 @@
18 'name': 'image1',
19 'deleted': False,
20 'container_format': None,
21+ 'checksum': None,
22 'created_at': '2011-03-22T17:40:15',
23 'disk_format': None,
24 'updated_at': '2011-03-22T17:40:15',
25@@ -52,6 +53,7 @@
26 'name': 'image2',
27 'deleted': False,
28 'container_format': None,
29+ 'checksum': None,
30 'created_at': '2011-03-22T17:40:15',
31 'disk_format': None,
32 'updated_at': '2011-03-22T17:40:15',
33@@ -67,6 +69,7 @@
34 'name': 'image3',
35 'deleted': False,
36 'container_format': None,
37+ 'checksum': None,
38 'created_at': '2011-03-22T17:40:15',
39 'disk_format': None,
40 'updated_at': '2011-03-22T17:40:15',
41@@ -103,7 +106,10 @@
42 res = req.get_response(fakes.wsgi_app())
43 res_dict = json.loads(res.body)
44 self.assertEqual(200, res.status_int)
45- self.assertEqual('value1', res_dict['metadata']['key1'])
46+ expected = self.IMAGE_FIXTURES[0]['properties']
47+ self.assertEqual(len(expected), len(res_dict['metadata']))
48+ for (key, value) in res_dict['metadata'].items():
49+ self.assertEqual(value, res_dict['metadata'][key])
50
51 def test_show(self):
52 req = webob.Request.blank('/v1.1/images/1/meta/key1')