filesystem: better autoinstall error when no disk

If no disk found was large enough for guided autoinstall, catch that
case and report it.  Without this, we get a rather unhelpful error:
FAIL: 'NoneType' object has no attribute 'grub_device'
This commit is contained in:
Dan Bungert 2021-10-15 14:27:01 -06:00
parent 3c32cb773c
commit d9370ae54b
1 changed files with 3 additions and 0 deletions

View File

@ -435,6 +435,9 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
disk = self.model.disk_for_match(
self.model.all_disks(),
layout.get("match", {'size': 'largest'}))
if not disk:
raise Exception("autoinstall cannot configure storage "
"- no disk found large enough for install")
meth(disk)
elif 'config' in self.ai_data:
self.model.apply_autoinstall_config(self.ai_data['config'])