From d83a3a6b2f3ca1f1ece9940408af7f31c18d7c23 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 24 Nov 2022 10:39:00 +0100 Subject: [PATCH] gocd/rabbit-openqa.py: Ignore isos which don't have an OpenQAMapping Every medium to be tested needs to include a staging specific part which OpenQAMapping specifies. If this does not match we better not use it as it might find some unrelated tests. --- gocd/rabbit-openqa.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gocd/rabbit-openqa.py b/gocd/rabbit-openqa.py index 369a44c4..a028d7c0 100755 --- a/gocd/rabbit-openqa.py +++ b/gocd/rabbit-openqa.py @@ -48,10 +48,16 @@ class Project(object): new = parts[2] new = new.replace('$LETTER', self.staging_letter(staging_project)) try: - return re.compile(old).sub(new, iso) + stagingiso = re.compile(old).sub(new, iso) except re.error: self.logger.error(f"_MAP_ISO {self.replace_string} does not create valid regexps in {self.name}") - return iso + return None + + if stagingiso == iso: + self.logger.info(f"{self.replace_string} did not map {iso} properly, ignoring") + return None + + return stagingiso def gather_isos(self, name, repository): url = self.api.makeurl(['published', name, repository, 'iso']) @@ -61,6 +67,10 @@ class Project(object): for entry in root.findall('entry'): if entry.get('name').endswith('iso'): ret.append(self.map_iso(name, entry.get('name'))) + + # Filter out isos which couldn't be mapped + ret = [iso for iso in ret if iso] + return ret def gather_buildid(self, name, repository):