storage/v1: handle variations for guided_GET

Purposefully simple as this is not believed to be a real use case to
have multiple variations.
This commit is contained in:
Dan Bungert 2023-04-12 18:32:22 -06:00
parent 1cc39ab7ee
commit 451c4d7b74
1 changed files with 14 additions and 2 deletions

View File

@ -569,8 +569,20 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
if probe_resp is not None:
return probe_resp
disks = self.potential_boot_disks(with_reformatting=True)
assert len(self._variation_info) == 1
[info] = self._variation_info.values()
# Choose the first non-core-boot one offered. If we only have
# core-boot choices, choose the first of those.
core_boot_info = None
for info in self._variation_info.values():
if not info.is_valid():
continue
if not info.is_core_boot_classic():
break
if core_boot_info is None:
core_boot_info = info
else:
info = core_boot_info
return GuidedStorageResponse(
status=ProbeStatus.DONE,
error_report=self.full_probe_error(),