Merge "Added command for device to cinder volume mapping"
This commit is contained in:
commit
dada6cc91d
novaclient
@ -2276,6 +2276,10 @@ class ShellTest(utils.TestCase):
|
||||
pos=-1
|
||||
)
|
||||
|
||||
def test_volume_attachments(self):
|
||||
self.run_command('volume-attachments 1234')
|
||||
self.assert_called('GET', '/servers/1234/os-volume_attachments')
|
||||
|
||||
def test_volume_create(self):
|
||||
_, err = self.run_command('volume-create 2 --display-name Work')
|
||||
self.assertIn('Command volume-create is deprecated', err)
|
||||
|
@ -2053,6 +2053,12 @@ def _translate_availability_zone_keys(collection):
|
||||
[('zoneName', 'name'), ('zoneState', 'status')])
|
||||
|
||||
|
||||
def _translate_volume_attachments_keys(collection):
|
||||
_translate_keys(collection,
|
||||
[('serverId', 'server_id'),
|
||||
('volumeId', 'volume_id')])
|
||||
|
||||
|
||||
@cliutils.arg(
|
||||
'--all-tenants',
|
||||
dest='all_tenants',
|
||||
@ -2225,6 +2231,17 @@ def do_volume_detach(cs, args):
|
||||
args.attachment_id)
|
||||
|
||||
|
||||
@cliutils.arg(
|
||||
'server',
|
||||
metavar='<server>',
|
||||
help=_('Name or ID of server.'))
|
||||
def do_volume_attachments(cs, args):
|
||||
"""List all the volumes attached to a server"""
|
||||
volumes = cs.volumes.get_server_volumes(_find_server(cs, args.server).id)
|
||||
_translate_volume_attachments_keys(volumes)
|
||||
utils.print_list(volumes, ['ID', 'DEVICE', 'SERVER ID', 'VOLUME ID'])
|
||||
|
||||
|
||||
def do_volume_snapshot_list(cs, _args):
|
||||
"""DEPRECATED: List all the snapshots."""
|
||||
emit_volume_deprecation_warning('volume-snapshot-list')
|
||||
|
Loading…
x
Reference in New Issue
Block a user