Apply suggestions from @ogayot

Co-authored-by: Olivier Gayot <olivier.gayot@sigexec.com>
This commit is contained in:
Michael Hudson-Doyle 2023-07-18 12:38:13 +12:00 committed by GitHub
parent acbc26bb36
commit 6d67a2dd6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -408,7 +408,7 @@ class InstallController(SubiquityController):
return return
state = await self.app.package_installer.install_pkg('efibootmgr') state = await self.app.package_installer.install_pkg('efibootmgr')
if state != PackageInstallState.DONE: if state != PackageInstallState.DONE:
raise Exception() raise RuntimeError('could not install efibootmgr')
efi_state_before = get_efibootmgr('/') efi_state_before = get_efibootmgr('/')
cmd = [ cmd = [
'efibootmgr', '--create', 'efibootmgr', '--create',
@ -421,7 +421,7 @@ class InstallController(SubiquityController):
efi_state_after = get_efibootmgr('/') efi_state_after = get_efibootmgr('/')
new_bootnums = ( new_bootnums = (
set(efi_state_after.entries) - set(efi_state_before.entries)) set(efi_state_after.entries) - set(efi_state_before.entries))
if len(new_bootnums) == 0: if not new_bootnums:
return return
new_bootnum = new_bootnums.pop() new_bootnum = new_bootnums.pop()
new_entry = efi_state_after.entries[new_bootnum] new_entry = efi_state_after.entries[new_bootnum]