source_koji.py: Properly handle unset pkgset_koji_tag

In one place, there was an explicit check if pkgset_koji_tag was set,
in another it was blindly referenced and assumed to be a list (with
accidental semi-success for a scalar.)

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
This commit is contained in:
Owen W. Taylor 2018-02-15 15:39:40 -05:00
parent cc8c7a702c
commit 303fb29a6c

View File

@ -274,7 +274,8 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event_id):
if not variant_tags[variant]:
variant_tags[variant].extend(force_list(compose.conf["pkgset_koji_tag"]))
# Add global tag if supplied.
# Add global tag(s) if supplied.
global_tags = []
if 'pkgset_koji_tag' in compose.conf:
if compose.conf["pkgset_koji_tag"] == "not-used":
# The magic value is used for modular composes to avoid errors
@ -283,7 +284,8 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event_id):
'option is no longer required. Remove it from '
'the configuration.')
else:
compose_tags.extend(force_list(compose.conf["pkgset_koji_tag"]))
global_tags = force_list(compose.conf["pkgset_koji_tag"])
compose_tags.extend(global_tags)
inherit = compose.conf["pkgset_koji_inherit"]
global_pkgset_path = os.path.join(
@ -328,7 +330,7 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event_id):
global_pkgset = pkgset
else:
global_pkgset.merge(pkgset, None, list(all_arches),
unique_name=compose_tag in compose.conf['pkgset_koji_tag'])
unique_name=compose_tag in global_tags)
with open(global_pkgset_path, 'wb') as f:
data = pickle.dumps(global_pkgset)
f.write(data)