diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-07-30 19:01:34 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-07-30 19:01:34 +0000 |
| commit | 172d0ea018c71645231fb754f2ebb0cf33ff556c (patch) | |
| tree | 3014bdd7adcd0a40df819e3757b6cdcbf26a444b /cinderclient/v2/shell.py | |
| parent | b4acbd2586a2b6f43ac51779e4f958862753d2ed (diff) | |
| parent | ae04b4b09982bf98ed963fb541da5f3bf73b9a17 (diff) | |
| download | python-cinderclient-172d0ea018c71645231fb754f2ebb0cf33ff556c.tar.gz | |
Merge "Add tenant uuid when running cinder list --all-tenants"
Diffstat (limited to 'cinderclient/v2/shell.py')
| -rw-r--r-- | cinderclient/v2/shell.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 10b7631..a2735d8 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -97,7 +97,8 @@ def _translate_keys(collection, convert): def _translate_volume_keys(collection): - convert = [('volumeType', 'volume_type')] + convert = [('volumeType', 'volume_type'), + ('os-vol-tenant-attr:tenant_id', 'tenant_id')] _translate_keys(collection, convert) @@ -177,8 +178,13 @@ def do_list(cs, args): servers = [s.get('server_id') for s in vol.attachments] setattr(vol, 'attached_to', ','.join(map(str, servers))) - utils.print_list(volumes, ['ID', 'Status', 'Name', - 'Size', 'Volume Type', 'Bootable', 'Attached to']) + if all_tenants: + key_list = ['ID', 'Tenant ID', 'Status', 'Name', + 'Size', 'Volume Type', 'Bootable', 'Attached to'] + else: + key_list = ['ID', 'Status', 'Name', + 'Size', 'Volume Type', 'Bootable', 'Attached to'] + utils.print_list(volumes, key_list) @utils.arg('volume', |
