pkgset: Allow unsigned packages by empty key

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-10-16 13:48:27 +02:00
parent b79ff7d8dd
commit 68fdef451c
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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)