From 566f32b01efbcbd13b0bcf643fb5fe6b3c42f959 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 3 Aug 2022 13:56:08 +0200 Subject: [PATCH] source: don't mark search_drivers required In the source autoinstall section, the search_drivers key was marked required. This made sense at the time when it was the only supported key. However, now that we also support the source ID, we don't want to force the user to supply search_drivers as well. Signed-off-by: Olivier Gayot --- autoinstall-schema.json | 5 +---- subiquity/server/controllers/source.py | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/autoinstall-schema.json b/autoinstall-schema.json index 34a5c22c..05b21120 100644 --- a/autoinstall-schema.json +++ b/autoinstall-schema.json @@ -127,10 +127,7 @@ "id": { "type": "string" } - }, - "required": [ - "search_drivers" - ] + } }, "network": { "oneOf": [ diff --git a/subiquity/server/controllers/source.py b/subiquity/server/controllers/source.py index 06373a9c..9c04d5df 100644 --- a/subiquity/server/controllers/source.py +++ b/subiquity/server/controllers/source.py @@ -64,7 +64,6 @@ class SourceController(SubiquityController): "type": "string", }, }, - "required": ["search_drivers"], } # Defaults to true for backward compatibility with existing autoinstall # configurations. Back then, then users were able to install third-party @@ -89,11 +88,7 @@ class SourceController(SubiquityController): # "source: null" despite "type" being "object" data = {**self.autoinstall_default, "id": None} - # search_drivers is marked required so the schema validator should - # reject any missing data. - assert "search_drivers" in data - - self.model.search_drivers = data["search_drivers"] + self.model.search_drivers = data.get("search_drivers", True) # At this point, the model has not yet loaded the sources from the # catalog. So we store the data and lean on apply_autoinstall_config.