From 64ba19cde4cf1e085727306b229c2004d0ae0187 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Fri, 14 Feb 2020 20:54:34 +0000 Subject: [PATCH] Fix architecture check if Release file is used When the architecture are read from the Release file, they are not defined in the config file. Adding 'all' as an architecture will not give the correct result. To avoid confusion, explicitly check for this and error out if it is added. --- britney2/inputs/suiteloader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/britney2/inputs/suiteloader.py b/britney2/inputs/suiteloader.py index 31e6c80..106fe20 100644 --- a/britney2/inputs/suiteloader.py +++ b/britney2/inputs/suiteloader.py @@ -19,8 +19,6 @@ class SuiteContentLoader(object): def __init__(self, base_config): self._base_config = base_config self._architectures = SuiteContentLoader.config_str_as_list(base_config.architectures) - assert 'all' not in self._architectures, "all not allowed in architectures" - self._nobreakall_arches = SuiteContentLoader.config_str_as_list(base_config.nobreakall_arches, []) self._outofsync_arches = SuiteContentLoader.config_str_as_list(base_config.outofsync_arches, []) self._break_arches = SuiteContentLoader.config_str_as_list(base_config.break_arches, []) @@ -135,6 +133,7 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader): # Intern architectures for efficiency; items in this list will be used for lookups and # building items/keys - by intern strings we reduce memory (considerably). self._architectures = [sys.intern(arch) for arch in allarches] + assert 'all' not in self._architectures, "all not allowed in architectures" def _get_suite_name(self, suite, release_file): for name in ('Suite', 'Codename'):