Rebase to koji 1.15.0

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
epel9
Patrick Uiterwijk 7 years ago
parent 1175772991
commit 13c3161ee0

1
.gitignore vendored

@ -11,3 +11,4 @@ koji-1.4.0.tar.bz2
/koji-1.12.0.tar.bz2
/koji-1.13.0.tar.bz2
/koji-1.14.0.tar.bz2
/koji-1.15.0.tar.bz2

@ -1,38 +0,0 @@
From 5574ad78171c9e9e56f9c565aeb95bd8c6f2d107 Mon Sep 17 00:00:00 2001
From: Mike McLean <mikem@redhat.com>
Date: Nov 22 2017 05:24:28 +0000
Subject: PR#703: cli: make return code of watch_task to always ignore sub-task failure
Merges #703
https://pagure.io/koji/pull-request/703
Fixes: #696
https://pagure.io/koji/issue/696
koji 1.14.0 returns exit status 1 on jobs with only optional failures
---
diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py
index 4135308..761dff2 100644
--- a/cli/koji_cli/lib.py
+++ b/cli/koji_cli/lib.py
@@ -285,7 +285,7 @@ def watch_tasks(session, tasklist, quiet=False, poll_interval=60):
try:
tasks = {}
for task_id in tasklist:
- tasks[task_id] = TaskWatcher(task_id,session,quiet=quiet)
+ tasks[task_id] = TaskWatcher(task_id, session, quiet=quiet)
while True:
all_done = True
for task_id, task in list(tasks.items()):
@@ -297,7 +297,7 @@ def watch_tasks(session, tasklist, quiet=False, poll_interval=60):
# task is done and state just changed
if not quiet:
display_tasklist_status(tasks)
- if not task.is_success():
+ if task.level == 0 and not task.is_success():
rv = 1
for child in session.getTaskChildren(task_id):
child_id = child['id']

@ -1,75 +0,0 @@
diff -rup koji-1.14.0.orig/koji/__init__.py koji-1.14.0/koji/__init__.py
--- koji-1.14.0.orig/koji/__init__.py 2017-09-25 19:37:51.000000000 +0000
+++ koji-1.14.0/koji/__init__.py 2017-12-04 17:44:04.774853630 +0000
@@ -23,6 +23,7 @@
from __future__ import absolute_import
+import copy
import sys
from six.moves import range
from six.moves import zip
@@ -2116,16 +2117,15 @@ class ClientSession(object):
principal. The principal must be in the "ProxyPrincipals" list on
the server side."""
- if principal is None and keytab is None and ccache is None:
- try:
- # Silently try GSSAPI first
- if self.gssapi_login(proxyuser=proxyuser):
- return True
- except:
- if krbV:
- pass
- else:
- raise
+ try:
+ # Silently try GSSAPI first
+ if self.gssapi_login(principal, keytab, ccache, proxyuser=proxyuser):
+ return True
+ except:
+ if krbV:
+ pass
+ else:
+ raise
if not krbV:
raise PythonImportError(
@@ -2203,7 +2203,7 @@ class ClientSession(object):
return '%s/%s@%s' % (service, servername, realm)
- def gssapi_login(self, proxyuser=None):
+ def gssapi_login(self, principal=None, keytab=None, ccache=None, proxyuser=None):
if not HTTPKerberosAuth:
raise PythonImportError(
"Please install python-requests-kerberos to use GSSAPI."
@@ -2220,10 +2220,18 @@ class ClientSession(object):
# 60 second timeout during login
sinfo = None
+ old_env = copy.copy(os.environ)
old_opts = self.opts
self.opts = old_opts.copy()
self.opts['timeout'] = 60
- self.opts['auth'] = HTTPKerberosAuth()
+ kwargs = {}
+ if keytab:
+ os.environ['KRB5_CLIENT_KTNAME'] = keytab
+ if ccache:
+ os.environ['KRB5CCNAME'] = ccache
+ if principal:
+ kwargs['principal'] = principal
+ self.opts['auth'] = HTTPKerberosAuth(**kwargs)
try:
try:
# Depending on the server configuration, we might not be able to
@@ -2235,6 +2243,7 @@ class ClientSession(object):
self.baseurl = old_baseurl
finally:
self.opts = old_opts
+ os.environ = old_env
if not sinfo:
raise AuthError('unable to obtain a session')
Only in koji-1.14.0/koji: __init__.py.orig

@ -1,27 +0,0 @@
From 73ebc0c98fb7766f2ddddc41f0a2ab662ba5c467 Mon Sep 17 00:00:00 2001
From: Yuming Zhu <yzhu@redhat.com>
Date: Nov 22 2017 05:24:24 +0000
Subject: cli: make return code of watch_task to always ignore sub-task failure
fixes: #696
---
diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py
index 4135308..e7aa686 100644
--- a/cli/koji_cli/lib.py
+++ b/cli/koji_cli/lib.py
@@ -218,9 +218,11 @@ class TaskWatcher(object):
state = koji.TASK_STATES[self.info['state']]
return (state in ['CLOSED','CANCELED','FAILED'])
- def is_success(self):
+ def is_success(self, ignore_child=True):
if self.info is None:
return False
+ if ignore_child and self.level != 0:
+ return True
state = koji.TASK_STATES[self.info['state']]
return (state == 'CLOSED')

@ -1,5 +1,6 @@
--- koji-1.13.0/cli/koji.conf.fedoraconfig 2017-06-30 14:00:26.000000000 -0500
+++ koji-1.13.0/cli/koji.conf 2017-07-03 12:41:55.615758878 -0500
diff -rup koji-1.15.0.orig/cli/koji.conf koji-1.15.0/cli/koji.conf
--- koji-1.15.0.orig/cli/koji.conf 2018-01-27 10:44:39.111029362 +0100
+++ koji-1.15.0/cli/koji.conf 2018-01-27 10:46:33.713817186 +0100
@@ -3,18 +3,23 @@
;configuration for koji cli tool
@ -27,9 +28,9 @@
;the service name of the principal being used by the hub
;krbservice = host
@@ -25,13 +30,6 @@
;the keytab to auth as for automated clients
;keytab = /etc/krb5.keytab
@@ -29,13 +34,6 @@
;krb_canon_host = no
-;configuration for SSL authentication
-

@ -25,8 +25,8 @@
%endif
Name: koji
Version: 1.14.0
Release: 4%{?dist}
Version: 1.15.0
Release: 1%{?dist}
# koji.ssl libs (from plague) are GPLv2+
License: LGPLv2 and GPLv2+
Summary: Build system tools
@ -35,10 +35,7 @@ URL: https://pagure.io/koji/
Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2
# Backported patches
Patch0: https://pagure.io/koji/pull-request/708.patch
Patch1: https://pagure.io/koji/c/5574ad7.patch
Patch2: https://pagure.io/koji/c/73ebc0c.patch
Patch3: https://pagure.io/koji/pull-request/735.patch
Patch0: https://pagure.io/koji/pull-request/735.patch
# Not upstreamable
Patch100: fedora-config.patch
@ -246,9 +243,6 @@ koji-web is a web UI to the Koji system.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch100 -p1 -b .fedoraconfig
%build
@ -454,6 +448,9 @@ fi
%endif
%changelog
* Sat Jan 27 2018 Patrick Uiterwijk <patrick@puiterwijk.org> - 1.15.0-1
- Rebase to koji 1.15.0
* Mon Jan 22 2018 Troy Dawson <tdawson@redhat.com> - 1.14.0-4
- Update conditional

@ -1 +1 @@
SHA512 (koji-1.14.0.tar.bz2) = 76df705e490ba4be3efbe8a0236ee9904cd15c9ae1b8a8045f09d1fa811f5c7a5bd9987f676e7e776c1da092bb5a3be173837edb6dc0b6141c77b445b76349e9
SHA512 (koji-1.15.0.tar.bz2) = 680f76328900c2519745e392b576cc33cce3349bc3428001c8db1ff068bf9fdf071e0096ece837729fba86cd79708553dc6b6b7334316b3e02f1c3089164d418

Loading…
Cancel
Save