Drop compatibility with Koji < 1.32
The 1.32 version with checksum API has been released more than 2 years ago. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com> (cherry picked from commit 65336b406c01a99ccc9dabd011cc969b4395e106)
This commit is contained in:
parent
fc2cc0073a
commit
dcd7e5ff2a
@ -548,22 +548,14 @@ class KojiPackageSet(PackageSetBase):
|
|||||||
pathinfo = self.koji_wrapper.koji_module.pathinfo
|
pathinfo = self.koji_wrapper.koji_module.pathinfo
|
||||||
paths = []
|
paths = []
|
||||||
|
|
||||||
if "getRPMChecksums" in self.koji_wrapper.koji_methods:
|
def checksum_validator(keyname, pkg_path):
|
||||||
|
checksums = self.koji_proxy.getRPMChecksums(
|
||||||
def checksum_validator(keyname, pkg_path):
|
rpm_info["id"], checksum_types=("sha256",)
|
||||||
checksums = self.koji_proxy.getRPMChecksums(
|
)
|
||||||
rpm_info["id"], checksum_types=("sha256",)
|
if "sha256" in checksums.get(keyname, {}):
|
||||||
)
|
computed = compute_file_checksums(pkg_path, ("sha256",))
|
||||||
if "sha256" in checksums.get(keyname, {}):
|
if computed["sha256"] != checksums[keyname]["sha256"]:
|
||||||
computed = compute_file_checksums(pkg_path, ("sha256",))
|
raise RuntimeError("Checksum mismatch for %s" % pkg_path)
|
||||||
if computed["sha256"] != checksums[keyname]["sha256"]:
|
|
||||||
raise RuntimeError("Checksum mismatch for %s" % pkg_path)
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
def checksum_validator(keyname, pkg_path):
|
|
||||||
# Koji doesn't support checksums yet
|
|
||||||
pass
|
|
||||||
|
|
||||||
attempts_left = self.signed_packages_retries + 1
|
attempts_left = self.signed_packages_retries + 1
|
||||||
while attempts_left > 0:
|
while attempts_left > 0:
|
||||||
|
@ -72,8 +72,6 @@ class KojiWrapper(object):
|
|||||||
self.koji_proxy = tracing.instrument_xmlrpc_proxy(
|
self.koji_proxy = tracing.instrument_xmlrpc_proxy(
|
||||||
koji.ClientSession(self.koji_module.config.server, session_opts)
|
koji.ClientSession(self.koji_module.config.server, session_opts)
|
||||||
)
|
)
|
||||||
with tracing.span("koji.system.listMethods"):
|
|
||||||
self.koji_methods = self.koji_proxy.system.listMethods()
|
|
||||||
|
|
||||||
# This retry should be removed once https://pagure.io/koji/issue/3170 is
|
# This retry should be removed once https://pagure.io/koji/issue/3170 is
|
||||||
# fixed and released.
|
# fixed and released.
|
||||||
|
@ -158,7 +158,6 @@ class TestKojiPkgset(PkgsetCompareMixin, helpers.PungiTestCase):
|
|||||||
self.koji_downloader = helpers.FSKojiDownloader()
|
self.koji_downloader = helpers.FSKojiDownloader()
|
||||||
self.koji_wrapper = mock.Mock()
|
self.koji_wrapper = mock.Mock()
|
||||||
self.koji_wrapper.koji_proxy.listTaggedRPMS.return_value = self.tagged_rpms
|
self.koji_wrapper.koji_proxy.listTaggedRPMS.return_value = self.tagged_rpms
|
||||||
self.koji_wrapper.koji_methods = ["getRPM", "getRPMChecksums"]
|
|
||||||
self.koji_wrapper.koji_module.pathinfo = self.path_info
|
self.koji_wrapper.koji_module.pathinfo = self.path_info
|
||||||
|
|
||||||
def _touch_files(self, filenames):
|
def _touch_files(self, filenames):
|
||||||
|
Loading…
Reference in New Issue
Block a user