diff options
| author | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-29 17:13:40 -0700 |
|---|---|---|
| committer | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-29 17:13:40 -0700 |
| commit | 27b92e509c71a8b79dc6240aecdf598bf9d608f1 (patch) | |
| tree | 1d3e32013b5b28ca88a215e64c72474f15adcb41 | |
| parent | ded3416d48980c32eb20f95665f281ffc2927517 (diff) | |
Change volume so that it returns attachments in the same format as is used for the attachment object
| -rw-r--r-- | nova/api/openstack/incubator/volumes.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/nova/api/openstack/incubator/volumes.py b/nova/api/openstack/incubator/volumes.py index 0e6a1d0e9..f96e20ed4 100644 --- a/nova/api/openstack/incubator/volumes.py +++ b/nova/api/openstack/incubator/volumes.py @@ -44,15 +44,10 @@ def _translate_volume_detail_view(context, vol): return d -def _translate_volume_summary_view(_context, vol): +def _translate_volume_summary_view(context, vol): """Maps keys for volumes summary view.""" d = {} - instance_id = None - attached_to = vol.get('instance') - if attached_to: - instance_id = attached_to['id'] - d['id'] = vol['id'] d['status'] = vol['status'] d['size'] = vol['size'] @@ -60,12 +55,7 @@ def _translate_volume_summary_view(_context, vol): d['createdAt'] = vol['created_at'] if vol['attach_status'] == 'attached': - d['attachments'] = [{'attachTime': vol['attach_time'], - 'deleteOnTermination': False, - 'mountpoint': vol['mountpoint'], - 'instanceId': instance_id, - 'status': 'attached', - 'volumeId': vol['id']}] + d['attachments'] = [_translate_attachment_detail_view(context, vol)] else: d['attachments'] = [{}] |
