dnf changed the type of gpgkey to a tuple

And in an intermediate version it returns a VectorString object which
isn't serializable by the json or toml modules.

So convert it to a list so that the type is consistent in the sources
code.

(cherry picked from commit e9e5139750)

Resolves: rhbz#1655876
This commit is contained in:
Brian C. Lane 2018-10-19 10:55:44 -07:00
parent 6a2f574ed7
commit 2ad4b20a91
1 changed files with 3 additions and 3 deletions

View File

@ -355,7 +355,7 @@ def dnf_repo_to_file_repo(repo):
it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with
only the attributes we care about. only the attributes we care about.
""" """
repo_str = "[%s]\n" % repo.id repo_str = "[%s]\nname = %s\n" % (repo.id, repo.name)
if repo.metalink: if repo.metalink:
repo_str += "metalink = %s\n" % repo.metalink repo_str += "metalink = %s\n" % repo.metalink
elif repo.mirrorlist: elif repo.mirrorlist:
@ -430,7 +430,7 @@ def repo_to_source(repo, system_source):
source["check_gpg"] = True source["check_gpg"] = True
if repo.gpgkey: if repo.gpgkey:
source["gpgkey_urls"] = repo.gpgkey source["gpgkey_urls"] = list(repo.gpgkey)
return source return source
@ -484,7 +484,7 @@ def source_to_repo(source, dnf_conf):
repo.gpgcheck = False repo.gpgcheck = False
if "gpgkey_urls" in source: if "gpgkey_urls" in source:
repo.gpgkey = ",".join(source["gpgkey_urls"]) repo.gpgkey = tuple(source["gpgkey_urls"])
repo.enable() repo.enable()