Skip to content

Commit

Permalink
Don't attempt to enumerate over an empty command list
Browse files Browse the repository at this point in the history
This avoids a crash in both the installer and the validation script when
a command list such as early-commands is provided in the Autoinstall
YAML, but no entries are included. This causes the value of that key to
be None instead of an empty list and triggers an exception in
load_autoinstall_data(). Ignoring that value causes it to behave as if
that command list was not provided at all.
  • Loading branch information
penguin359 committed Sep 3, 2024
1 parent 37a9793 commit 0ec2a8e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subiquity/server/controllers/cmdlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def __init__(self, app):
self.run_event = asyncio.Event()

def load_autoinstall_data(self, data):
if data is None:
return
self.cmds = [Command(args=cmd, check=self.cmd_check) for cmd in data]

def env(self):
Expand Down

0 comments on commit 0ec2a8e

Please sign in to comment.