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):
'server_id': 'fakeuuid',
'id': '1',
'volume_id': '1'}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},
'server_id': 'fakeuuid',
'id': '1',
'volume_id': '1'}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'image_id': 'c905cedb-7281-47e4-8a62-f26bc5fc4c77',
'snapshot_id': None,
'server_id': 'fakeuuid',
'device': '/',
}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},
'server_id': 'fakeuuid',
'device': '/',
}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {"qos_max_iops": 2000},
'server_id': 'fakeuuid',
'id': '1',
'volume_id': '1'}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},
'server_id': 'fakeuuid',
'id': '1',
'volume_id': '1'}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},
'server_id': 'fakeuuid',
'id': '1',
'volume_id': '1'}],
+ 'bootable': 'false',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},
'availability_zone': 'fakeaz',
'display_name': 'displayname',
'attachments': [],
+ 'bootable': 'false',
+ 'volume_type': 'vol_type_name',
+ 'snapshot_id': None,
+ 'metadata': {},
+ 'id': '1',
+ 'created_at': datetime.datetime(1, 1, 1,
+ 1, 1, 1),
+ 'size': 1}}
+ self.assertEqual(res_dict, expected)
+
+ def test_volume_show_bootable(self):
+ def stub_volume_get(self, context, volume_id):
+ return (fakes.stub_volume(volume_id,
+ volume_glance_metadata=dict(foo='bar')))
+
+ self.stubs.Set(volume_api.API, 'get', stub_volume_get)
+
+ req = fakes.HTTPRequest.blank('/v1/volumes/1')
+ res_dict = self.controller.show(req, '1')
+ expected = {'volume': {'status': 'fakestatus',
+ 'display_description': 'displaydesc',
+ 'availability_zone': 'fakeaz',
+ 'display_name': 'displayname',
+ 'attachments': [{'device': '/',
+ 'server_id': 'fakeuuid',
+ 'id': '1',
+ 'volume_id': '1'}],
+ 'bootable': 'true',
'volume_type': 'vol_type_name',
'snapshot_id': None,
'metadata': {},