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:
TerryHowe 2015-08-28 10:34:50 -06:00
parent f14251669f
commit 14a714f2a2
3 changed files with 10 additions and 9 deletions

View File

@ -15,14 +15,15 @@
import copy
import mock
from openstackclient.tests.compute.v2 import fakes as compute_fakes
from openstackclient.tests import 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 import utils
volume_attachment_server = copy.deepcopy(compute_fakes.SERVER)
volume_attachment_server['device'] = 'device'
volume_attachment_server = {
'device': '/dev/ice',
'server_id': '1233',
}
volume_id = "ce26708d-a7f8-4b4b-9861-4a80256615a6"
volume_name = "fake_volume"

View File

@ -548,7 +548,7 @@ class TestVolumeList(TestVolume):
]
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']
msg = 'Attached to %s on %s ' % (server, device)
datalist = ((
@ -583,7 +583,7 @@ class TestVolumeList(TestVolume):
]
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']
msg = 'Attached to %s on %s ' % (server, device)
datalist = ((
@ -618,7 +618,7 @@ class TestVolumeList(TestVolume):
)
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']
msg = 'Attached to %s on %s ' % (server, device)
@ -654,7 +654,7 @@ class TestVolumeList(TestVolume):
)
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']
msg = 'Attached to %s on %s ' % (server, device)
datalist = ((
@ -693,7 +693,7 @@ class TestVolumeList(TestVolume):
]
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']
msg = 'Attached to %s on %s ' % (server, device)
datalist = ((

View File

@ -238,7 +238,7 @@ class ListVolume(lister.Lister):
msg = ''
for attachment in attachments:
server = attachment['id']
server = attachment['server_id']
if server in server_cache:
server = server_cache[server].name
device = attachment['device']