Skip to content

Commit

Permalink
Fix updater startup crash
Browse files Browse the repository at this point in the history
The _get_stale_qubes function doesn't check for an empty output, which leads to a startup crash.
Check if index 0 contains ":" (required for splitting) before continuing. If it doesn't, it returns an empty set.
  • Loading branch information
Minimalist73 committed May 13, 2024
1 parent a442f92 commit 9cae2b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qui/updater/intro_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ def _get_stale_qubes(self, cmd):
output = subprocess.check_output(cmd)
self.log.debug("Command returns: %s", output.decode())

output_lines = output.decode().split("\n")
if ":" not in output_lines[0]:
return set()

return {
vm_name.strip() for vm_name
in output.decode().split("\n", maxsplit=1)[0]
.split(":", maxsplit=1)[1].split(",")
in output_lines[0].split(":", maxsplit=1)[1].split(",")
}
except subprocess.CalledProcessError as err:
if err.returncode != 100:
Expand Down

0 comments on commit 9cae2b7

Please sign in to comment.