Skip to content

Commit

Permalink
DeviceTreeViewer: Add path-id attribute to zfcp-attached SCSI disks
Browse files Browse the repository at this point in the history
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
e74030e ("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 <maier@linux.ibm.com>

Related: RHEL-11384
  • Loading branch information
steffen-maier authored and rvykydal committed Jan 19, 2024
1 parent 8214219 commit 0d84736
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pyanaconda/modules/common/structures/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def attrs(self) -> Dict[Str, Str]:
fcp-lun
wwpn
hba-id
path-id
:return: a dictionary of attributes
"""
Expand Down
1 change: 1 addition & 0 deletions pyanaconda/modules/storage/devicetree/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,17 @@ 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")
assert data['type'] == get_variant(Str, 'zfcp')
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):
Expand Down

0 comments on commit 0d84736

Please sign in to comment.