summaryrefslogtreecommitdiff
path: root/cinderclient/v3
diff options
context:
space:
mode:
authorEric Harney <eharney@redhat.com>2019-03-07 12:25:06 -0500
committerEric Harney <eharney@redhat.com>2019-03-07 12:25:06 -0500
commit17a1c4a14a7efd335084a864769c1dcc2142d132 (patch)
treeddf5e7c6ec2c88d203a5a0e5d95f16686b8fdbaf /cinderclient/v3
parenta39805c6f45baf94c0d14da3ae775ee204a267ee (diff)
downloadpython-cinderclient-17a1c4a14a7efd335084a864769c1dcc2142d132.tar.gz
Add bash completion for groups
Completion for group create/list. Change-Id: I0b7027a72a3bc8ad7ca7323c6dbe0a501616cdd5
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 3b47f04..a7d2679 100644
--- a/cinderclient/v3/shell.py
+++ b/cinderclient/v3/shell.py
@@ -1348,6 +1348,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',
@@ -1411,6 +1425,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',