diff options
author | Eric Harney <eharney@redhat.com> | 2019-03-07 12:25:06 -0500 |
---|---|---|
committer | Eric Harney <eharney@redhat.com> | 2019-03-07 12:25:06 -0500 |
commit | 17a1c4a14a7efd335084a864769c1dcc2142d132 (patch) | |
tree | ddf5e7c6ec2c88d203a5a0e5d95f16686b8fdbaf /cinderclient/v3 | |
parent | a39805c6f45baf94c0d14da3ae775ee204a267ee (diff) | |
download | python-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.py | 25 |
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', |