Skip to content

Commit

Permalink
Removes image type validation in the Glance registry.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rconradharris authored and Tarmac committed Feb 17, 2011
2 parents f19fb80 + c131d93 commit 1f890ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glance/registry/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Image(BASE, ModelBase):

@validates('type')
def validate_type(self, key, type):
if not type in ('machine', 'kernel', 'ramdisk', 'raw'):
if not type in ('machine', 'kernel', 'ramdisk', 'raw', 'vhd'):
raise exception.Invalid(
"Invalid image type '%s' for image." % type)
return type
Expand Down

0 comments on commit 1f890ec

Please sign in to comment.