From 6a56fe8146d863fea03b60562b667d458ad0a4f1 Mon Sep 17 00:00:00 2001 From: Drew Thorstensen Date: Wed, 13 May 2015 13:39:51 -0500 Subject: [PATCH] Update vscsi mapping to not include adapter This change updates the vscsi.py to not send the adapter down when requesting that the scsi adapter be connected. This was due to a recent change in pypowervm, and the refactor was missed in the nova-powervm code. An additional unit test was added to cover this. Change-Id: Ic8555f49f213e3e7e46a59e1518984ef5e0f431b --- nova_powervm/tests/virt/powervm/volume/test_vscsi.py | 3 +++ nova_powervm/virt/powervm/volume/vscsi.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nova_powervm/tests/virt/powervm/volume/test_vscsi.py b/nova_powervm/tests/virt/powervm/volume/test_vscsi.py index 4509fe98..524911e5 100644 --- a/nova_powervm/tests/virt/powervm/volume/test_vscsi.py +++ b/nova_powervm/tests/virt/powervm/volume/test_vscsi.py @@ -75,6 +75,9 @@ class TestVSCSIAdapter(test.TestCase): con_info) # Single mapping self.assertEqual(1, mock_add_vscsi_mapping.call_count) + mock_add_vscsi_mapping.assert_called_with( + 'host_uuid', '3443DB77-AED1-47ED-9AA5-3DB9C6CF7089', 'vm_uuid', + mock.ANY) @mock.patch('pypowervm.tasks.hdisk.remove_hdisk') @mock.patch('pypowervm.tasks.scsi_mapper.remove_pv_mapping') diff --git a/nova_powervm/virt/powervm/volume/vscsi.py b/nova_powervm/virt/powervm/volume/vscsi.py index 24081cdc..63c6f7ca 100644 --- a/nova_powervm/virt/powervm/volume/vscsi.py +++ b/nova_powervm/virt/powervm/volume/vscsi.py @@ -264,7 +264,7 @@ class VscsiVolumeAdapter(v_driver.FibreChannelVolumeAdapter): :param device_name: The The hdisk device name """ pv = pvm_stor.PV.bld(adapter, device_name) - tsk_map.add_vscsi_mapping(adapter, host_uuid, vios_uuid, vm_uuid, pv) + tsk_map.add_vscsi_mapping(host_uuid, vios_uuid, vm_uuid, pv) def _get_udid(self, instance, vios_uuid, volume_id): """This method will return the hdisk udid stored in system metadata.