The dict(rv.iteritems()) agains the volume object from
volume.api.get does NOT set the volume_glance_metadata k/v.
This is used to show bootable in the show and list api calls,
the result was that list properly reflected the bootable status
of a volume, however show would always describe the flag as False.
So we simply check if the rv includes the glance_metadata and if
so go ahead and create the entry in the volume dict.
Fixes bug:
1115629
Change-Id: Ia0be08f3d2c85b7fe8390fca264803c96cdce7f7
def get(self, context, volume_id):
rv = self.db.volume_get(context, volume_id)
+ glance_meta = rv.get('volume_glance_metadata', None)
volume = dict(rv.iteritems())
check_policy(context, 'get', volume)
+
+ # NOTE(jdg): As per bug 1115629 iteritems doesn't pick
+ # up the glance_meta dependency, add it explicitly if
+ # it exists in the rv
+ if glance_meta:
+ volume['volume_glance_metadata'] = glance_meta
+
return volume
def get_all(self, context, marker=None, limit=None, sort_key='created_at',