From d88332edceb241d2880d57b7df3a26e965630383 Mon Sep 17 00:00:00 2001 From: "Loren M. Lang" Date: Sun, 1 Sep 2024 22:40:27 -0700 Subject: [PATCH] Don't attempt to enumerate over an empty command list 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. --- subiquity/server/controllers/cmdlist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subiquity/server/controllers/cmdlist.py b/subiquity/server/controllers/cmdlist.py index 2729da5c4..178d5bb2a 100644 --- a/subiquity/server/controllers/cmdlist.py +++ b/subiquity/server/controllers/cmdlist.py @@ -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):