diff options
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/volume/snapshots.py | 5 | ||||
| -rw-r--r-- | nova/api/openstack/volume/types.py | 2 | ||||
| -rw-r--r-- | nova/api/openstack/volume/volumes.py | 13 |
3 files changed, 15 insertions, 5 deletions
diff --git a/nova/api/openstack/volume/snapshots.py b/nova/api/openstack/volume/snapshots.py index b6dc83170..abfdd602e 100644 --- a/nova/api/openstack/volume/snapshots.py +++ b/nova/api/openstack/volume/snapshots.py @@ -46,8 +46,9 @@ def _translate_snapshot_summary_view(context, vol): """Maps keys for snapshots summary view.""" d = {} - d['id'] = vol['id'] - d['volumeId'] = vol['volume_id'] + # TODO(bcwaldon): remove str cast once we use uuids + d['id'] = str(vol['id']) + d['volumeId'] = str(vol['volume_id']) d['status'] = vol['status'] # NOTE(gagupta): We map volume_size as the snapshot size d['size'] = vol['volume_size'] diff --git a/nova/api/openstack/volume/types.py b/nova/api/openstack/volume/types.py index 80875e06f..0b55e6ebc 100644 --- a/nova/api/openstack/volume/types.py +++ b/nova/api/openstack/volume/types.py @@ -67,6 +67,8 @@ class VolumeTypesController(object): except exception.NotFound: raise exc.HTTPNotFound() + # TODO(bcwaldon): remove str cast once we use uuids + vol_type['id'] = str(vol_type['id']) return {'volume_type': vol_type} diff --git a/nova/api/openstack/volume/volumes.py b/nova/api/openstack/volume/volumes.py index 10d83a000..45ad297a4 100644 --- a/nova/api/openstack/volume/volumes.py +++ b/nova/api/openstack/volume/volumes.py @@ -48,7 +48,8 @@ def _translate_attachment_summary_view(_context, vol): """Maps keys for attachment summary view.""" d = {} - volume_id = vol['id'] + # TODO(bcwaldon): remove str cast once we use uuids + volume_id = str(vol['id']) # NOTE(justinsb): We use the volume id as the id of the attachment object d['id'] = volume_id @@ -76,7 +77,8 @@ def _translate_volume_summary_view(context, vol): """Maps keys for volumes summary view.""" d = {} - d['id'] = vol['id'] + # TODO(bcwaldon): remove str cast once we use uuids + d['id'] = str(vol['id']) d['status'] = vol['status'] d['size'] = vol['size'] d['availabilityZone'] = vol['availability_zone'] @@ -93,9 +95,14 @@ def _translate_volume_summary_view(context, vol): if vol['volume_type_id'] and vol.get('volume_type'): d['volumeType'] = vol['volume_type']['name'] else: - d['volumeType'] = vol['volume_type_id'] + # TODO(bcwaldon): remove str cast once we use uuids + d['volumeType'] = str(vol['volume_type_id']) d['snapshotId'] = vol['snapshot_id'] + # TODO(bcwaldon): remove str cast once we use uuids + if d['snapshotId'] is not None: + d['snapshotId'] = str(d['snapshotId']) + LOG.audit(_("vol=%s"), vol, context=context) if vol.get('volume_metadata'): |
