Merge "Re-enable shell UUID completion cache"
This commit is contained in:
commit
3c143d95b3
|
@ -23,6 +23,7 @@ import os
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
import cinderclient
|
||||||
from cinderclient import api_versions
|
from cinderclient import api_versions
|
||||||
from cinderclient import base
|
from cinderclient import base
|
||||||
from cinderclient import exceptions
|
from cinderclient import exceptions
|
||||||
|
@ -175,6 +176,13 @@ def do_backup_list(cs, args):
|
||||||
if show_count:
|
if show_count:
|
||||||
print("Backup in total: %s" % total_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',
|
@utils.arg('--detail',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
@ -391,6 +399,12 @@ def do_list(cs, args):
|
||||||
servers = [s.get('server_id') for s in vol.attachments]
|
servers = [s.get('server_id') for s in vol.attachments]
|
||||||
setattr(vol, 'attached_to', ','.join(map(str, servers)))
|
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:
|
if field_titles:
|
||||||
# Remove duplicate fields
|
# Remove duplicate fields
|
||||||
key_list = ['ID']
|
key_list = ['ID']
|
||||||
|
@ -641,6 +655,11 @@ def do_create(cs, args):
|
||||||
|
|
||||||
utils.print_dict(info)
|
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',
|
@utils.arg('volume',
|
||||||
metavar='<volume>',
|
metavar='<volume>',
|
||||||
|
@ -2403,6 +2422,12 @@ def do_backup_create(cs, args):
|
||||||
|
|
||||||
utils.print_dict(info)
|
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>',
|
@utils.arg('volume', metavar='<volume>',
|
||||||
help='Name or ID of volume to transfer.')
|
help='Name or ID of volume to transfer.')
|
||||||
|
|
Loading…
Reference in New Issue