From 785b567abec6b4c2fae898f0dbaada1c1374a0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 2 Jan 2017 10:21:41 +0100 Subject: [PATCH 1/4] koji-shadow: allow use without certs --- util/koji-shadow | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/util/koji-shadow b/util/koji-shadow index 48baaf9a..c1d192bc 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -307,17 +307,18 @@ def activate_session(session): """Test and login the session is applicable""" global options - # convert to absolute paths - options.auth_cert = os.path.expanduser(options.auth_cert) - options.auth_ca = os.path.expanduser(options.auth_ca) - options.serverca = os.path.expanduser(options.serverca) - if options.noauth: #skip authentication pass - elif os.path.isfile(options.auth_cert): - # authenticate using SSL client cert - session.ssl_login(options.auth_cert, options.auth_ca, options.serverca, proxyuser=options.runas) + elif options.auth_cert and options.auth_ca and options.serverca: + # convert to absolute paths + options.auth_cert = os.path.expanduser(options.auth_cert) + options.auth_ca = os.path.expanduser(options.auth_ca) + options.serverca = os.path.expanduser(options.serverca) + + if os.path.isfile(options.auth_cert): + # authenticate using SSL client cert + session.ssl_login(options.auth_cert, options.auth_ca, options.serverca, proxyuser=options.runas) elif options.user: #authenticate using user/password session.login() From 4b2085e7f70d2c33ac3ea0337c8627ed1100f04c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 18 Jan 2017 09:55:26 +0100 Subject: [PATCH 2/4] koji-shadow: remove authca, it's not used for ssl_login any more --- util/koji-shadow | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/util/koji-shadow b/util/koji-shadow index c1d192bc..9442fa82 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -129,8 +129,6 @@ def get_options(): help=_("location to store work files")) parser.add_option("--auth-cert", help=_("Certificate for authentication")) - parser.add_option("--auth-ca", - help=_("CA certificate for authentication")) parser.add_option("--serverca", help=_("Server CA certificate")) parser.add_option("--rules", @@ -208,7 +206,6 @@ def get_options(): ['max_jobs', None, 'int'], ['serverca', None, 'string'], ['auth_cert', None, 'string'], - ['auth_ca', None, 'string'], ['arches', None, 'string'], ] @@ -310,15 +307,14 @@ def activate_session(session): if options.noauth: #skip authentication pass - elif options.auth_cert and options.auth_ca and options.serverca: + elif options.auth_cert and options.serverca: # convert to absolute paths options.auth_cert = os.path.expanduser(options.auth_cert) - options.auth_ca = os.path.expanduser(options.auth_ca) options.serverca = os.path.expanduser(options.serverca) if os.path.isfile(options.auth_cert): # authenticate using SSL client cert - session.ssl_login(options.auth_cert, options.auth_ca, options.serverca, proxyuser=options.runas) + session.ssl_login(cert=options.auth_cert, serverca=options.serverca, proxyuser=options.runas) elif options.user: #authenticate using user/password session.login() From 552e79d98fdd33cf76eab8ab863cecf9d57e3254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Sat, 21 Jan 2017 19:53:49 +0100 Subject: [PATCH 3/4] koji-shadow: fix log() invocation --- util/koji-shadow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/koji-shadow b/util/koji-shadow index 9442fa82..39c63d9a 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -1122,7 +1122,7 @@ class BuildTracker(object): n_replaced = len(builds) - len(not_replaced) log("%s: %i (+%i replaced)" % (state, len(not_replaced), n_replaced)) if not_replaced and len(not_replaced) < 8: - log('', ' '.join([b.nvr for b in not_replaced])) + log(' '.join([b.nvr for b in not_replaced])) #generate a report of the most frequent problem deps problem_counts = {} for build in self.state_idx['brokendeps'].values(): From c41881a8b6bc3cbc4350f8f216f1a3c3596adc4e Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Thu, 26 Jan 2017 16:36:36 +0100 Subject: [PATCH 4/4] preserve old option for compatibility --- util/koji-shadow | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/koji-shadow b/util/koji-shadow index 39c63d9a..d92aca3e 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -129,6 +129,8 @@ def get_options(): help=_("location to store work files")) parser.add_option("--auth-cert", help=_("Certificate for authentication")) + parser.add_option("--auth-ca", # DEPRECATED and ignored + help=optparse.SUPPRESS_HELP) parser.add_option("--serverca", help=_("Server CA certificate")) parser.add_option("--rules",