Merge lp:~rconradharris/glance/bug720459 into lp:~glance-coresec/glance/cactus-trunk

Proposed by Rick Harris
Status: Merged
Approved by: Jay Pipes
Approved revision: 76
Merged at revision: 74
Proposed branch: lp:~rconradharris/glance/bug720459
Merge into: lp:~glance-coresec/glance/cactus-trunk
Diff against target: 12 lines (+1/-1)
1 file modified
glance/registry/db/models.py (+1/-1)
To merge this branch: bzr merge lp:~rconradharris/glance/bug720459
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Devin Carlen (community) Approve
Review via email: mp+50098@code.launchpad.net

Description of the change

Removes image type validation in the Glance registry.

Nova xs-unified-images requires adding a new image type 'vhd' along side of 'machine', 'raw', etc. Since image_type isn't used by Glance itself (it merely stores the value and hands it back to Nova), Glance shouldn't be the arbiter of what values are acceptable-- Nova should. This promotes loose-coupling and ensures that Glance won't have to change in lock-step with Nova.

More to the point, this a stop-gap to make Glance work with the new xs-unified-images branch until we get proper `container_format` and `disk_format` modeling in Glance. When that happens, we may end up ditching `image_type` altogether.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

this will break a variety of tests in bug704854. Is it possible to remove this image_type when we do the disk_format changes? Is there a reason this patch has to hit before that blueprint is completed?

lp:~rconradharris/glance/bug720459 updated
75. By Rick Harris

Reverting the removal of validation

76. By Rick Harris

Adding vhd as recognized image type

Revision history for this message
Rick Harris (rconradharris) wrote :

Per conversation with Jay, I've updated the patch to add 'vhd' as one of the recognized image types (rather than remove validation entirely).

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

ty, rick :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'glance/registry/db/models.py'
2--- glance/registry/db/models.py 2011-02-02 06:13:39 +0000
3+++ glance/registry/db/models.py 2011-02-17 18:38:43 +0000
4@@ -103,7 +103,7 @@
5
6 @validates('type')
7 def validate_type(self, key, type):
8- if not type in ('machine', 'kernel', 'ramdisk', 'raw'):
9+ if not type in ('machine', 'kernel', 'ramdisk', 'raw', 'vhd'):
10 raise exception.Invalid(
11 "Invalid image type '%s' for image." % type)
12 return type

Subscribers

People subscribed via source and target branches