From 68fdef451c86963dfec91f608971d4e4d95dbdd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 16 Oct 2017 13:48:27 +0200 Subject: [PATCH] pkgset: Allow unsigned packages by empty key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently `None` has to be included to allow using unsigned packages. ODCS has trouble with including non-string value in the list though, so we can treat empty string the same way (it's not a valid key ID anyway). Signed-off-by: Lubomír Sedlář --- doc/configuration.rst | 3 ++- pungi/phases/pkgset/pkgsets.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index df3ca544..950a98c7 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -435,7 +435,8 @@ Options ------- **sigkeys** - ([*str* or None]) -- priority list of sigkeys, *None* means unsigned + ([*str* or None]) -- priority list of sigkeys; if the list includes an + empty string or *None*, unsigned packages will be allowed **pkgset_source** [mandatory] (*str*) -- "koji" (any koji instance) or "repos" (arbitrary yum repositories) diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py index e570b891..c9ba6426 100644 --- a/pungi/phases/pkgset/pkgsets.py +++ b/pungi/phases/pkgset/pkgsets.py @@ -238,7 +238,7 @@ class KojiPackageSet(PackageSetBase): pathinfo = self.koji_wrapper.koji_module.pathinfo paths = [] for sigkey in self.sigkey_ordering: - if sigkey is None: + if not sigkey: # we're looking for *signed* copies here continue sigkey = sigkey.lower() @@ -247,7 +247,7 @@ class KojiPackageSet(PackageSetBase): if os.path.isfile(rpm_path): return rpm_path - if None in self.sigkey_ordering: + if None in self.sigkey_ordering or '' in self.sigkey_ordering: # use an unsigned copy (if allowed) rpm_path = os.path.join(pathinfo.build(build_info), pathinfo.rpm(rpm_info)) paths.append(rpm_path)