Volume v2 list does not show server name
The volume v2 list was using the volume id rather than the server id. Change-Id: Ibe03d34b5b503af2d00202dabd640f796449cf9a Closes-Bug: #1489954
This commit is contained in:
parent
f14251669f
commit
14a714f2a2
@ -15,14 +15,15 @@
|
|||||||
import copy
|
import copy
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from openstackclient.tests.compute.v2 import fakes as compute_fakes
|
|
||||||
from openstackclient.tests import fakes
|
from openstackclient.tests import fakes
|
||||||
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
|
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
|
||||||
from openstackclient.tests.image.v2 import fakes as image_fakes
|
from openstackclient.tests.image.v2 import fakes as image_fakes
|
||||||
from openstackclient.tests import utils
|
from openstackclient.tests import utils
|
||||||
|
|
||||||
volume_attachment_server = copy.deepcopy(compute_fakes.SERVER)
|
volume_attachment_server = {
|
||||||
volume_attachment_server['device'] = 'device'
|
'device': '/dev/ice',
|
||||||
|
'server_id': '1233',
|
||||||
|
}
|
||||||
|
|
||||||
volume_id = "ce26708d-a7f8-4b4b-9861-4a80256615a6"
|
volume_id = "ce26708d-a7f8-4b4b-9861-4a80256615a6"
|
||||||
volume_name = "fake_volume"
|
volume_name = "fake_volume"
|
||||||
|
@ -548,7 +548,7 @@ class TestVolumeList(TestVolume):
|
|||||||
]
|
]
|
||||||
self.assertEqual(collist, columns)
|
self.assertEqual(collist, columns)
|
||||||
|
|
||||||
server = volume_fakes.volume_attachment_server['id']
|
server = volume_fakes.volume_attachment_server['server_id']
|
||||||
device = volume_fakes.volume_attachment_server['device']
|
device = volume_fakes.volume_attachment_server['device']
|
||||||
msg = 'Attached to %s on %s ' % (server, device)
|
msg = 'Attached to %s on %s ' % (server, device)
|
||||||
datalist = ((
|
datalist = ((
|
||||||
@ -583,7 +583,7 @@ class TestVolumeList(TestVolume):
|
|||||||
]
|
]
|
||||||
self.assertEqual(collist, columns)
|
self.assertEqual(collist, columns)
|
||||||
|
|
||||||
server = volume_fakes.volume_attachment_server['id']
|
server = volume_fakes.volume_attachment_server['server_id']
|
||||||
device = volume_fakes.volume_attachment_server['device']
|
device = volume_fakes.volume_attachment_server['device']
|
||||||
msg = 'Attached to %s on %s ' % (server, device)
|
msg = 'Attached to %s on %s ' % (server, device)
|
||||||
datalist = ((
|
datalist = ((
|
||||||
@ -618,7 +618,7 @@ class TestVolumeList(TestVolume):
|
|||||||
)
|
)
|
||||||
self.assertEqual(collist, tuple(columns))
|
self.assertEqual(collist, tuple(columns))
|
||||||
|
|
||||||
server = volume_fakes.volume_attachment_server['id']
|
server = volume_fakes.volume_attachment_server['server_id']
|
||||||
device = volume_fakes.volume_attachment_server['device']
|
device = volume_fakes.volume_attachment_server['device']
|
||||||
msg = 'Attached to %s on %s ' % (server, device)
|
msg = 'Attached to %s on %s ' % (server, device)
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ class TestVolumeList(TestVolume):
|
|||||||
)
|
)
|
||||||
self.assertEqual(collist, tuple(columns))
|
self.assertEqual(collist, tuple(columns))
|
||||||
|
|
||||||
server = volume_fakes.volume_attachment_server['id']
|
server = volume_fakes.volume_attachment_server['server_id']
|
||||||
device = volume_fakes.volume_attachment_server['device']
|
device = volume_fakes.volume_attachment_server['device']
|
||||||
msg = 'Attached to %s on %s ' % (server, device)
|
msg = 'Attached to %s on %s ' % (server, device)
|
||||||
datalist = ((
|
datalist = ((
|
||||||
@ -693,7 +693,7 @@ class TestVolumeList(TestVolume):
|
|||||||
]
|
]
|
||||||
self.assertEqual(collist, columns)
|
self.assertEqual(collist, columns)
|
||||||
|
|
||||||
server = volume_fakes.volume_attachment_server['id']
|
server = volume_fakes.volume_attachment_server['server_id']
|
||||||
device = volume_fakes.volume_attachment_server['device']
|
device = volume_fakes.volume_attachment_server['device']
|
||||||
msg = 'Attached to %s on %s ' % (server, device)
|
msg = 'Attached to %s on %s ' % (server, device)
|
||||||
datalist = ((
|
datalist = ((
|
||||||
|
@ -238,7 +238,7 @@ class ListVolume(lister.Lister):
|
|||||||
|
|
||||||
msg = ''
|
msg = ''
|
||||||
for attachment in attachments:
|
for attachment in attachments:
|
||||||
server = attachment['id']
|
server = attachment['server_id']
|
||||||
if server in server_cache:
|
if server in server_cache:
|
||||||
server = server_cache[server].name
|
server = server_cache[server].name
|
||||||
device = attachment['device']
|
device = attachment['device']
|
||||||
|
Loading…
Reference in New Issue
Block a user