s390x fc: Fix device path for Ubuntu with ds8k
The device path to a block device on Ubuntu using a ds8k LUN
differs from the device path for other storage systems.
This patch adds the new device path as third possibility.
Change-Id: I92f1e5a2c7203af6c01c4742067ced16a840eb04
(cherry picked from commit f28bd8ea85
)
This commit is contained in:
parent
078839732c
commit
e91f19b171
|
@ -71,14 +71,19 @@ class FibreChannelConnectorS390X(fibre_channel.FibreChannelConnector):
|
||||||
|
|
||||||
def _get_device_file_path(self, pci_num, target_wwn, lun):
|
def _get_device_file_path(self, pci_num, target_wwn, lun):
|
||||||
# NOTE(arne_r)
|
# NOTE(arne_r)
|
||||||
# Need to add two possible ways to resolve device paths,
|
# Need to add multiple possible ways to resolve device paths,
|
||||||
# depending on OS. Since it gets passed to '_get_possible_volume_paths'
|
# depending on OS. Since it gets passed to '_get_possible_volume_paths'
|
||||||
# having a mismatch is not a problem
|
# having a mismatch is not a problem
|
||||||
host_device = [
|
host_device = [
|
||||||
|
# RHEL based
|
||||||
"/dev/disk/by-path/ccw-%s-zfcp-%s:%s" % (
|
"/dev/disk/by-path/ccw-%s-zfcp-%s:%s" % (
|
||||||
pci_num, target_wwn, self._get_lun_string(lun)),
|
pci_num, target_wwn, self._get_lun_string(lun)),
|
||||||
|
# Debian based (e.g. for storwize)
|
||||||
"/dev/disk/by-path/ccw-%s-fc-%s-lun-%s" % (
|
"/dev/disk/by-path/ccw-%s-fc-%s-lun-%s" % (
|
||||||
pci_num, target_wwn, lun),
|
pci_num, target_wwn, lun),
|
||||||
|
# Debian based (e.g. for ds8k)
|
||||||
|
"/dev/disk/by-path/ccw-%s-fc-%s-lun-%s" % (
|
||||||
|
pci_num, target_wwn, self._get_lun_string(lun)),
|
||||||
]
|
]
|
||||||
return host_device
|
return host_device
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,13 @@ class FibreChannelConnectorS390XTestCase(test_connector.ConnectorTestCase):
|
||||||
devices = self.connector._get_host_devices(possible_devs, lun)
|
devices = self.connector._get_host_devices(possible_devs, lun)
|
||||||
mock_configure_scsi_device.assert_called_with(3, 5,
|
mock_configure_scsi_device.assert_called_with(3, 5,
|
||||||
"0x0002000000000000")
|
"0x0002000000000000")
|
||||||
self.assertEqual(2, len(devices))
|
self.assertEqual(3, len(devices))
|
||||||
device_path = "/dev/disk/by-path/ccw-3-zfcp-5:0x0002000000000000"
|
device_path = "/dev/disk/by-path/ccw-3-zfcp-5:0x0002000000000000"
|
||||||
self.assertEqual(devices[0], device_path)
|
self.assertEqual(devices[0], device_path)
|
||||||
device_path = "/dev/disk/by-path/ccw-3-fc-5-lun-2"
|
device_path = "/dev/disk/by-path/ccw-3-fc-5-lun-2"
|
||||||
self.assertEqual(devices[1], device_path)
|
self.assertEqual(devices[1], device_path)
|
||||||
|
device_path = "/dev/disk/by-path/ccw-3-fc-5-lun-0x0002000000000000"
|
||||||
|
self.assertEqual(devices[2], device_path)
|
||||||
|
|
||||||
def test_get_lun_string(self):
|
def test_get_lun_string(self):
|
||||||
lun = 1
|
lun = 1
|
||||||
|
|
Loading…
Reference in New Issue