From 2ad4b20a91b9962f1471f5b4845f81693a59b920 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 19 Oct 2018 10:55:44 -0700 Subject: [PATCH] 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 e9e5139750cc806f4e86b7d86c5ba12e319692dd) Resolves: rhbz#1655876 --- src/pylorax/api/projects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pylorax/api/projects.py b/src/pylorax/api/projects.py index 98bbe642..5c31d6c0 100644 --- a/src/pylorax/api/projects.py +++ b/src/pylorax/api/projects.py @@ -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 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: repo_str += "metalink = %s\n" % repo.metalink elif repo.mirrorlist: @@ -430,7 +430,7 @@ def repo_to_source(repo, system_source): source["check_gpg"] = True if repo.gpgkey: - source["gpgkey_urls"] = repo.gpgkey + source["gpgkey_urls"] = list(repo.gpgkey) return source @@ -484,7 +484,7 @@ def source_to_repo(source, dnf_conf): repo.gpgcheck = False if "gpgkey_urls" in source: - repo.gpgkey = ",".join(source["gpgkey_urls"]) + repo.gpgkey = tuple(source["gpgkey_urls"]) repo.enable()