diff --git a/openstackclient/tests/volume/v2/fakes.py b/openstackclient/tests/volume/v2/fakes.py index 0d8c2024c7..7b7758a3a8 100644 --- a/openstackclient/tests/volume/v2/fakes.py +++ b/openstackclient/tests/volume/v2/fakes.py @@ -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" diff --git a/openstackclient/tests/volume/v2/test_volume.py b/openstackclient/tests/volume/v2/test_volume.py index 348ae377de..b15fd02fc1 100644 --- a/openstackclient/tests/volume/v2/test_volume.py +++ b/openstackclient/tests/volume/v2/test_volume.py @@ -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 = (( diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py index fe4a3ff63f..1d298f46d3 100644 --- a/openstackclient/volume/v2/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -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']