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 <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2024-04-23 09:41:27 +02:00
parent dbcf723676
commit 92a47635d8
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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):