From 92a47635d8a988b4cc40a9a9d23d396c8c2a51c0 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 23 Apr 2024 09:41:27 +0200 Subject: [PATCH] filesystem: probe NVMe controllers when running the restricted probe If block probing times out, we rerun it with the restricted set of probes. Sadly, the restricted set does not include "nvme" so we do not enumerate NVMe controllers. This leads to the following error if NVMe storage devices are present: File "subiquity/models/filesystem.py", line 1492, in reset self.process_probe_data() File "subiquity/models/filesystem.py", line 1512, in process_probe_data self._orig_config = storage_config.extract_storage_config(self._probe_data)[ File "/site-packages/curtin/storage_config.py", line 1420, in extract_storage_config tree = get_config_tree(cfg.get('id'), final_config) File "/site-packages/curtin/storage_config.py", line 313, in get_config_tree for dep in find_item_dependencies(item, sconfig): File "/site-packages/curtin/storage_config.py", line 283, in find_item_dependencies _validate_dep_type(item_id, dep_key, dep, config) File "/site-packages/curtin/storage_config.py", line 230, in _validate_dep_type raise ValueError( ValueError: Invalid dep_id (nvme-controller-nvme0) not in storage config Fixed by also enumerating NVMe controllers as part of the restricted probe operation. Signed-off-by: Olivier Gayot --- subiquity/server/controllers/filesystem.py | 2 +- subiquity/server/controllers/tests/test_filesystem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subiquity/server/controllers/filesystem.py b/subiquity/server/controllers/filesystem.py index ed9d7cd3..f210267c 100644 --- a/subiquity/server/controllers/filesystem.py +++ b/subiquity/server/controllers/filesystem.py @@ -1270,7 +1270,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator): @with_context(name="probe_once", description="restricted={restricted}") async def _probe_once(self, *, context, restricted): if restricted: - probe_types = {"blockdev", "filesystem"} + probe_types = {"blockdev", "filesystem", "nvme"} fname = "probe-data-restricted.json" key = "ProbeDataRestricted" else: diff --git a/subiquity/server/controllers/tests/test_filesystem.py b/subiquity/server/controllers/tests/test_filesystem.py index 82a74850..cc1522fc 100644 --- a/subiquity/server/controllers/tests/test_filesystem.py +++ b/subiquity/server/controllers/tests/test_filesystem.py @@ -108,7 +108,7 @@ class TestSubiquityControllerFilesystem(IsolatedAsyncioTestCase): async def test_probe_restricted(self): await self.fsc._probe_once(context=None, restricted=True) - expected = {"blockdev", "filesystem"} + expected = {"blockdev", "filesystem", "nvme"} self.app.prober.get_storage.assert_called_with(expected) async def test_probe_os_prober_false(self):