From: John Griffith Date: Mon, 4 Feb 2013 23:18:29 +0000 (-0700) Subject: Add volume_glance_metadata to volume.api.get X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f32253f7391da22b6d69a4afebda5cdd99bb40d3;p=openstack-build%2Fcinder-build.git Add volume_glance_metadata to volume.api.get 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 --- diff --git a/cinder/volume/api.py b/cinder/volume/api.py index 30f6c8450..eadced454 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -307,8 +307,16 @@ class API(base.Base): 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',