From 0d84736ede039fa4df566e62dbb4a987af42cf8e Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Wed, 22 Feb 2023 19:46:42 +0100 Subject: [PATCH] DeviceTreeViewer: Add path-id attribute to zfcp-attached SCSI disks Currently, the UI prints the kernel device names for multipath path members. Kernel device names are unpredictable and non-persistent and thus hardly suitable as path identifier for users. This is a preparation providing backend data to be used in a future commit to show in the UI. FCoE, iSCSI, and NVDIMM already have the attribute since commit e74030ef4c62 ("Add the path-id attribute to the DBus structure for device data"). Provide the same for zfcp-attached SCSI disks, which should always be used with multipathing. This change tolerates the absence of the id_path attribute if the corresponding change adding the attribute in blivet does not exist. Signed-off-by: Steffen Maier Related: RHEL-11384 --- anaconda.spec.in | 2 +- pyanaconda/modules/common/structures/storage.py | 1 + pyanaconda/modules/storage/devicetree/viewer.py | 1 + .../modules/storage/test_module_device_tree.py | 6 ++++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/anaconda.spec.in b/anaconda.spec.in index 9509393bd7c9..fad52a0d8820 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -37,7 +37,7 @@ Source0: %{name}-%{version}.tar.bz2 %define nmver 1.0 %define pykickstartver 3.32.10-1 %define pypartedver 2.5-2 -%define pythonblivetver 1:3.6.0-4 +%define pythonblivetver 1:3.6.0-13 %define rpmver 4.10.0 %define simplelinever 1.8.3-1 %define subscriptionmanagerver 1.29.31 diff --git a/pyanaconda/modules/common/structures/storage.py b/pyanaconda/modules/common/structures/storage.py index f65e9d649183..51f7d322da55 100644 --- a/pyanaconda/modules/common/structures/storage.py +++ b/pyanaconda/modules/common/structures/storage.py @@ -186,6 +186,7 @@ def attrs(self) -> Dict[Str, Str]: fcp-lun wwpn hba-id + path-id :return: a dictionary of attributes """ diff --git a/pyanaconda/modules/storage/devicetree/viewer.py b/pyanaconda/modules/storage/devicetree/viewer.py index 6e9d68adb9c2..2bf8e597bd93 100644 --- a/pyanaconda/modules/storage/devicetree/viewer.py +++ b/pyanaconda/modules/storage/devicetree/viewer.py @@ -176,6 +176,7 @@ def _set_device_data_zfcp(self, device, data): data.attrs["fcp-lun"] = self._get_attribute(device, "fcp_lun") data.attrs["wwpn"] = self._get_attribute(device, "wwpn") data.attrs["hba-id"] = self._get_attribute(device, "hba_id") + data.attrs["path-id"] = self._get_attribute(device, "id_path") def get_format_data(self, device_name): """Get the device format data. diff --git a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py index 15889bdac4fb..6bbe6331f0f9 100644 --- a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py +++ b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py @@ -345,7 +345,8 @@ def test_get_zfcp_device_data(self): size=Size("10 GiB"), fcp_lun="0x5719000000000000", wwpn="0x5005076300c18154", - hba_id="0.0.010a" + hba_id="0.0.010a", + id_path="ccw-0.0.010a-fc-0x5005076300c18154-lun-0x5719000000000000" )) data = self.interface.GetDeviceData("dev1") @@ -353,7 +354,8 @@ def test_get_zfcp_device_data(self): assert data['attrs'] == get_variant(Dict[Str, Str], { "fcp-lun": "0x5719000000000000", "wwpn": "0x5005076300c18154", - "hba-id": "0.0.010a" + "hba-id": "0.0.010a", + "path-id": "ccw-0.0.010a-fc-0x5005076300c18154-lun-0x5719000000000000" }) def test_get_format_data(self):