diff --git a/subiquity/server/server.py b/subiquity/server/server.py index c39cebd5..61f2aa39 100644 --- a/subiquity/server/server.py +++ b/subiquity/server/server.py @@ -668,7 +668,19 @@ class SubiquityServer(Application): context=ctx, ) - def load_autoinstall_config(self, *, only_early): + @with_context(name="read_config") + def _read_config(self, *, cfg_path: str, context: Context) -> dict[str, Any]: + with open(cfg_path) as fp: + config: dict[str, Any] = yaml.safe_load(fp) + + autoinstall_config: dict[str, Any] = dict() + + autoinstall_config = config + + return autoinstall_config + + @with_context() + def load_autoinstall_config(self, *, only_early, context): log.debug( "load_autoinstall_config only_early %s file %s", only_early, @@ -689,8 +701,9 @@ class SubiquityServer(Application): self.interactive = True return - with open(self.autoinstall) as fp: - self.autoinstall_config = yaml.safe_load(fp) + self.autoinstall_config = self._read_config( + cfg_path=self.autoinstall, context=context + ) # Check every time self.interactive = bool(self.autoinstall_config.get("interactive-sections"))