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
This commit is contained in:
Drew Thorstensen 2015-05-13 13:39:51 -05:00
parent 2f99f2f4fe
commit 6a56fe8146
2 changed files with 4 additions and 1 deletions

View File

@ -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')

View File

@ -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.