From 79c4cf332a23c13f375b0a7bf92eb9d26c738cb5 Mon Sep 17 00:00:00 2001 From: Adam Kankovsky Date: Wed, 23 Oct 2024 16:18:58 +0200 Subject: [PATCH 1/2] Introduce isleaf to deviceData Add the isleaf attribute to the deviceData attribute to make it clear in the device tree when it is a leaf node in the device tree. --- pyanaconda/modules/storage/devicetree/viewer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyanaconda/modules/storage/devicetree/viewer.py b/pyanaconda/modules/storage/devicetree/viewer.py index 451ffad1fc8..07d22e4618f 100644 --- a/pyanaconda/modules/storage/devicetree/viewer.py +++ b/pyanaconda/modules/storage/devicetree/viewer.py @@ -142,6 +142,7 @@ def _set_device_data(self, device, data): if isinstance(device, PartitionDevice): data.attrs["partition-type-name"] = self._get_attribute(device, "part_type_name") + data.attrs["isleaf"] = self._get_attribute(device, "isleaf") def _set_device_data_dasd(self, device, data): """Set data for a DASD device.""" From 4bf8a694469ea149cd196561886173c88e202f8e Mon Sep 17 00:00:00 2001 From: Adam Kankovsky Date: Thu, 24 Oct 2024 11:16:36 +0200 Subject: [PATCH 2/2] unit_test: extend existing device tree checks with isleaf attribute --- .../pyanaconda_tests/modules/storage/test_module_device_tree.py | 1 + 1 file changed, 1 insertion(+) 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 5858a5b4a4f..e5b4496d2be 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 @@ -364,6 +364,7 @@ def test_get_parted_device_data(self): data = self.interface.GetDeviceData("dev1") assert data['attrs']['partition-type-name'] == "Microsoft reserved partition" + assert data['attrs']['isleaf'] == "True" def test_get_format_data(self): """Test GetFormatData."""