From 451c4d7b747906401f384cd7435a3b330c36775b Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Wed, 12 Apr 2023 18:32:22 -0600 Subject: [PATCH] storage/v1: handle variations for guided_GET Purposefully simple as this is not believed to be a real use case to have multiple variations. --- subiquity/server/controllers/filesystem.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/subiquity/server/controllers/filesystem.py b/subiquity/server/controllers/filesystem.py index ec987938..8c8bb021 100644 --- a/subiquity/server/controllers/filesystem.py +++ b/subiquity/server/controllers/filesystem.py @@ -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(),