You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koji/2649.patch

52 lines
1.5 KiB

From 7675881c5481d7157c64c6a2a008fac7fbf5c495 Mon Sep 17 00:00:00 2001
From: Tomas Kopecek <tkopecek@redhat.com>
Date: Jan 15 2021 11:56:31 +0000
Subject: [PATCH 1/2] kojid: backward compatible hub call
Fixes: https://pagure.io/koji/issue/2648
---
diff --git a/builder/kojid b/builder/kojid
index 7f4557a..ca33a00 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -1328,7 +1328,12 @@ class BuildArchTask(BaseBuildTask):
weight is scaled from a minimum of 1.5 to a maximum of 6, based on
the average duration of a build of this package.
"""
- avg = self.session.getAverageBuildDuration(name, age=6)
+ try:
+ avg = self.session.getAverageBuildDuration(name, age=6)
+ except ParameterError:
+ # for hub < 1.23
+ avg = self.session.getAverageBuildDuration(name)
+
if not avg:
return
if avg < 0:
From a53aa56b87a569ccb8eb3173f7eddfe86b2dfea2 Mon Sep 17 00:00:00 2001
From: Tomas Kopecek <tkopecek@redhat.com>
Date: Jan 15 2021 15:23:44 +0000
Subject: [PATCH 2/2] typo
---
diff --git a/builder/kojid b/builder/kojid
index ca33a00..b503405 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -1330,7 +1330,7 @@ class BuildArchTask(BaseBuildTask):
"""
try:
avg = self.session.getAverageBuildDuration(name, age=6)
- except ParameterError:
+ except koji.ParameterError:
# for hub < 1.23
avg = self.session.getAverageBuildDuration(name)