log and ignore systems (in the snapd sense) we cannot install

These errors are really errors in how the ISO is constructed, so logging
and ignoring seems more appropriate, compared to say encryption being
unavailable because the TPM is in lockout mode.
This commit is contained in:
Michael Hudson-Doyle 2023-06-09 14:47:09 +12:00
parent 211ee4e7b5
commit 1fa3d3065e
1 changed files with 16 additions and 11 deletions

View File

@ -261,6 +261,19 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
return system
def info_for_system(self, name: str, label: str, system: SystemDetails):
if len(system.volumes) > 1:
log.error(
"Skipping uninstallable system: %s",
system_multiple_volumes_text)
return None
[volume] = system.volumes.values()
if volume.schema != 'gpt':
log.error(
"Skipping uninstallable system: %s",
system_non_gpt_text)
return None
info = VariationInfo(
name=name,
label=label,
@ -268,15 +281,6 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
system=system,
)
if len(system.volumes) > 1:
info.error = system_multiple_volumes_text
return info
[volume] = system.volumes.values()
if volume.schema != 'gpt':
info.error = system_non_gpt_text
return info
se = system.storage_encryption
if se.support == StorageEncryptionSupport.DEFECTIVE:
info.error = system_defective_encryption_text.format(
@ -321,8 +325,9 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
system = await self._get_system(name, label)
log.debug("got system %s for variation %s", system, name)
if system is not None and len(system.volumes) > 0:
self._variation_info[name] = self.info_for_system(
name, label, system)
info = self.info_for_system(name, label, system)
if info is not None:
self._variation_info[name] = info
else:
# This calculation is pretty much a hack and we should
# actually think about it at some point (like: maybe the