From b05258fa267c9d4346c59caefc5de96a78e26843 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Tue, 9 Apr 2024 21:45:45 +0200 Subject: [PATCH] tools/osbuild-depsolve-dnf: match dnf repo props Some of the repository properties in the request were named differently than the equivalent properties in the dnf repository configuration. This can introduce bugs and confusion. One such issue already existed with osbuild/images using 'gpgcheck' in the request, osbuild-depsolve-dnf checking for 'check_gpg', and the dnf repository configuration property being 'gpgcheck'. This didn't cause any bad behaviour because osbuild/images reused the original (internal) configuration to set the property in stages and depsolving isn't affected by the value of this property. Change the request properties to match the dnf repository configuration to avoid confusion: gpgcheck, repo_gpgcheck, and sslverify. Users of osbuild-depsolve-dnf (osbuild/images) should use property names that match dnf. Use the same names in the response. To maintain the same behaviour for SSL verification, a missing sslverify default to True. The previous property had the opposite meaning, ignore_ssl, and defaulted to False. --- tools/osbuild-depsolve-dnf | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/osbuild-depsolve-dnf b/tools/osbuild-depsolve-dnf index 58e96c50..15433d91 100755 --- a/tools/osbuild-depsolve-dnf +++ b/tools/osbuild-depsolve-dnf @@ -107,8 +107,7 @@ class Solver(): else: raise ValueError("missing either `baseurl`, `metalink`, or `mirrorlist` in repo") - if desc.get("ignoressl", False): - repo.sslverify = False + repo.sslverify = desc.get("sslverify", True) if "sslcacert" in desc: repo.sslcacert = desc["sslcacert"] if "sslclientkey" in desc: @@ -116,10 +115,10 @@ class Solver(): if "sslclientcert" in desc: repo.sslclientcert = desc["sslclientcert"] - if "check_gpg" in desc: - repo.gpgcheck = desc["check_gpg"] - if "check_repogpg" in desc: - repo.repo_gpgcheck = desc["check_repogpg"] + if "gpgcheck" in desc: + repo.gpgcheck = desc["gpgcheck"] + if "repo_gpgcheck" in desc: + repo.repo_gpgcheck = desc["repo_gpgcheck"] if "gpgkey" in desc: repo.gpgkey = [desc["gpgkey"]] if "gpgkeys" in desc: @@ -295,9 +294,9 @@ class Solver(): "metalink": repo.metalink, "mirrorlist": repo.mirrorlist, "gpgcheck": repo.gpgcheck, - "check_repogpg": repo.repo_gpgcheck, + "repo_gpgcheck": repo.repo_gpgcheck, "gpgkeys": read_keys(repo.gpgkey, root_dir if repo.id not in request_repo_ids else None), - "ignoressl": not bool(repo.sslverify), + "sslverify": bool(repo.sslverify), "sslcacert": repo.sslcacert, "sslclientkey": repo.sslclientkey, "sslclientcert": repo.sslclientcert,