From ce7e05431f0c089519231b74beefd2452c0db6b4 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 13 Dec 2023 16:42:17 +0100 Subject: [PATCH] add udev-builtin-path_id property to zfcp-attached SCSI disks --- ...-path_id-property-to-zfcp-attached-S.patch | 60 +++++++++++++++++++ python-blivet.spec | 7 ++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch diff --git a/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch b/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch new file mode 100644 index 0000000..ccefb9c --- /dev/null +++ b/0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch @@ -0,0 +1,60 @@ +From e65ff27b7e7907258faf25bd94880c310ce6744a Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Thu, 23 Feb 2023 13:28:50 +0100 +Subject: [PATCH] add udev-builtin-path_id property to zfcp-attached SCSI disks + +so anaconda can use it to display path_id information for multipath +members + +Signed-off-by: Steffen Maier +--- + blivet/devices/disk.py | 2 ++ + blivet/populator/helpers/disk.py | 1 + + tests/unit_tests/tags_test.py | 2 +- + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py +index 5053f7bb..1db4b940 100644 +--- a/blivet/devices/disk.py ++++ b/blivet/devices/disk.py +@@ -469,10 +469,12 @@ class ZFCPDiskDevice(DiskDevice): + :keyword hba_id: ??? + :keyword wwpn: ??? + :keyword fcp_lun: ??? ++ :keyword id_path: string from udev-builtin-path_id + """ + self.hba_id = kwargs.pop("hba_id") + self.wwpn = kwargs.pop("wwpn") + self.fcp_lun = kwargs.pop("fcp_lun") ++ self.id_path = kwargs.pop("id_path") + DiskDevice.__init__(self, device, **kwargs) + self._clear_local_tags() + self.tags.add(Tags.remote) +diff --git a/blivet/populator/helpers/disk.py b/blivet/populator/helpers/disk.py +index ce2cb73b..2d66f797 100644 +--- a/blivet/populator/helpers/disk.py ++++ b/blivet/populator/helpers/disk.py +@@ -223,6 +223,7 @@ class ZFCPDevicePopulator(DiskDevicePopulator): + def _get_kwargs(self): + kwargs = super(ZFCPDevicePopulator, self)._get_kwargs() + ++ kwargs["id_path"] = udev.device_get_path(self.data) + for attr in ['hba_id', 'wwpn', 'fcp_lun']: + kwargs[attr] = udev.device_get_zfcp_attribute(self.data, attr=attr) + +diff --git a/tests/unit_tests/tags_test.py b/tests/unit_tests/tags_test.py +index 49a2d72e..15fa2a40 100644 +--- a/tests/unit_tests/tags_test.py ++++ b/tests/unit_tests/tags_test.py +@@ -72,7 +72,7 @@ class DeviceTagsTest(unittest.TestCase): + fcoe_device = FcoeDiskDevice('test6', nic=None, identifier=None, id_path=None) + self.assertIn(Tags.remote, fcoe_device.tags) + self.assertNotIn(Tags.local, fcoe_device.tags) +- zfcp_device = ZFCPDiskDevice('test7', hba_id=None, wwpn=None, fcp_lun=None) ++ zfcp_device = ZFCPDiskDevice('test7', hba_id=None, wwpn=None, fcp_lun=None, id_path=None) + self.assertIn(Tags.remote, zfcp_device.tags) + self.assertNotIn(Tags.local, zfcp_device.tags) + +-- +2.43.0 + diff --git a/python-blivet.spec b/python-blivet.spec index 3dcbda9..3e3e113 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,7 +5,7 @@ Version: 3.8.2 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 1%{?prerelease}%{?dist} +Release: 2%{?prerelease}%{?dist} Epoch: 1 License: LGPL-2.1-or-later %global realname blivet @@ -17,6 +17,8 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver Patch0: 0001-remove-btrfs-plugin.patch %endif +Patch1: 0002-add-udev-builtin-path_id-property-to-zfcp-attached-S.patch + # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). %global partedver 1.8.1 @@ -112,6 +114,9 @@ make DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Wed Dec 13 2023 Vojtech Trefny - 3.8.2-2 +- add udev-builtin-path_id property to zfcp-attached SCSI disks + * Thu Oct 12 2023 Vojtech Trefny - 3.8.2-1 - tests: Ignore new pylint false positive with pylint 3.0 (vtrefny) - pylint: Use 'exit' instead of 'do_exit' for pylint.lint.Run (vtrefny)