summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-26 14:42:31 +0000
committerGerrit Code Review <review@openstack.org>2019-03-26 14:42:31 +0000
commit4e6ddd3e5aafceeb6ad6c95b24f1fa7a91a30cf6 (patch)
tree43baf9a7d945010e685210cf3d35e762d026d8b4
parent98b1f7c0dce4308855889649df0150aa90d758b7 (diff)
parent5a884fb68f8610b379ce5b6c7a857b3f78201359 (diff)
downloadpython-cinderclient-4e6ddd3e5aafceeb6ad6c95b24f1fa7a91a30cf6.tar.gz
Merge "Re-enable shell UUID completion cache" into stable/stein
-rw-r--r--cinderclient/v3/shell.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py
index 2cd3ffe..ec862dc 100644
--- a/cinderclient/v3/shell.py
+++ b/cinderclient/v3/shell.py
@@ -177,6 +177,13 @@ def do_backup_list(cs, args):
if show_count:
print("Backup in total: %s" % total_count)
+ with cs.backups.completion_cache(
+ 'uuid',
+ cinderclient.v3.volume_backups.VolumeBackup,
+ mode="w"):
+ for backup in backups:
+ cs.backups.write_to_completion_cache('uuid', backup.id)
+
@utils.arg('--detail',
action='store_true',
@@ -393,6 +400,12 @@ def do_list(cs, args):
servers = [s.get('server_id') for s in vol.attachments]
setattr(vol, 'attached_to', ','.join(map(str, servers)))
+ with cs.volumes.completion_cache('uuid',
+ cinderclient.v3.volumes.Volume,
+ mode="w"):
+ for vol in volumes:
+ cs.volumes.write_to_completion_cache('uuid', vol.id)
+
if field_titles:
# Remove duplicate fields
key_list = ['ID']
@@ -642,6 +655,11 @@ def do_create(cs, args):
utils.print_dict(info)
+ with cs.volumes.completion_cache('uuid',
+ cinderclient.v3.volumes.Volume,
+ mode="a"):
+ cs.volumes.write_to_completion_cache('uuid', volume.id)
+
@utils.arg('volume',
metavar='<volume>',
@@ -2402,6 +2420,12 @@ def do_backup_create(cs, args):
utils.print_dict(info)
+ with cs.backups.completion_cache(
+ 'uuid',
+ cinderclient.v3.volume_backups.VolumeBackup,
+ mode="a"):
+ cs.backups.write_to_completion_cache('uuid', backup.id)
+
@utils.arg('volume', metavar='<volume>',
help='Name or ID of volume to transfer.')