summaryrefslogtreecommitdiff
path: root/cinderclient/v3
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-06-03 17:27:43 +0000
committerGerrit Code Review <review@openstack.org>2019-06-03 17:27:43 +0000
commita9d9d347788f6a604d3dc7bbd43393efb73d8553 (patch)
tree4aa78631ceff58683085af8b0ce7553b2174a04f /cinderclient/v3
parent3a4221236f174f80178df4c2ec39334818b7e10e (diff)
parent17a1c4a14a7efd335084a864769c1dcc2142d132 (diff)
downloadpython-cinderclient-a9d9d347788f6a604d3dc7bbd43393efb73d8553.tar.gz
Merge "Add bash completion for groups"
Diffstat (limited to 'cinderclient/v3')
-rw-r--r--cinderclient/v3/shell.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py
index 121fbd9..73c037e 100644
--- a/cinderclient/v3/shell.py
+++ b/cinderclient/v3/shell.py
@@ -1352,6 +1352,20 @@ def do_group_list(cs, args):
columns = ['ID', 'Status', 'Name']
utils.print_list(groups, columns)
+ with cs.groups.completion_cache(
+ 'uuid',
+ cinderclient.v3.groups.Group,
+ mode='w'):
+ for group in groups:
+ cs.groups.write_to_completion_cache('uuid', group.id)
+ with cs.groups.completion_cache('name',
+ cinderclient.v3.groups.Group,
+ mode='w'):
+ for group in groups:
+ if group.name is None:
+ continue
+ cs.groups.write_to_completion_cache('name', group.name)
+
@api_versions.wraps('3.13')
@utils.arg('--list-volume',
@@ -1415,6 +1429,17 @@ def do_group_create(cs, args):
info.pop('links', None)
utils.print_dict(info)
+ with cs.groups.completion_cache('uuid',
+ cinderclient.v3.groups.Group,
+ mode='a'):
+ cs.groups.write_to_completion_cache('uuid', group.id)
+
+ if group.name is not None:
+ with cs.groups.completion_cache('name',
+ cinderclient.v3.groups.Group,
+ mode='a'):
+ cs.groups.write_to_completion_cache('name', group.name)
+
@api_versions.wraps('3.14')
@utils.arg('--group-snapshot',