summaryrefslogtreecommitdiff
path: root/cinderclient/shell_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cinderclient/shell_utils.py')
-rw-r--r--cinderclient/shell_utils.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/cinderclient/shell_utils.py b/cinderclient/shell_utils.py
index 451552e..e05d907 100644
--- a/cinderclient/shell_utils.py
+++ b/cinderclient/shell_utils.py
@@ -26,12 +26,13 @@ _quota_resources = ['volumes', 'snapshots', 'gigabytes',
_quota_infos = ['Type', 'In_use', 'Reserved', 'Limit', 'Allocated']
-def print_volume_image(image):
- if 'volume_type' in image[1]['os-volume_upload_image']:
- volume_type_name = (
- image[1]['os-volume_upload_image']['volume_type']['name'])
- image[1]['os-volume_upload_image']['volume_type'] = volume_type_name
- utils.print_dict(image[1]['os-volume_upload_image'])
+def print_volume_image(image_resp_tuple):
+ # image_resp_tuple = tuple (response, body)
+ image = image_resp_tuple[1]
+ vt = image['os-volume_upload_image'].get('volume_type')
+ if vt is not None:
+ image['os-volume_upload_image']['volume_type'] = vt.get('name')
+ utils.print_dict(image['os-volume_upload_image'])
def poll_for_status(poll_fn, obj_id, action, final_ok_states,