Add volume bootable information to api response

If there is any glance metadata associated with a volume, we'll consider
the volume bootable. This will return the information for both /volumes
and /detail calls.

blueprint list-bootable-volumes

Change-Id: Id9dbe5cb648be62fb19bb8bd6a97d8eab05ec25a
This commit is contained in:
Mike Perez
2012-11-18 21:27:39 -08:00
parent 3f183070f7
commit 040d9309c5
4 changed files with 46 additions and 0 deletions

View File

@@ -213,6 +213,11 @@ class VolumeGlanceMetadata(BASE, CinderBase):
snapshot_id = Column(String(36), ForeignKey('snapshots.id'))
key = Column(String(255))
value = Column(Text)
volume = relationship(Volume, backref="volume_glance_metadata",
foreign_keys=volume_id,
primaryjoin='and_('
'VolumeGlanceMetadata.volume_id == Volume.id,'
'VolumeGlanceMetadata.deleted == False)')
class Quota(BASE, CinderBase):