From 329cc108de849f25eec0e970c809c8e90f01c47b Mon Sep 17 00:00:00 2001 From: Dan Horák Date: Jan 18 2017 08:57:02 +0000 Subject: [PATCH 1/3] koji-shadow: allow use without certs --- diff --git a/util/koji-shadow b/util/koji-shadow index 48baaf9..c1d192b 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 d268ec5a91b6e7ce690624a9cc962b2feea4c31a Mon Sep 17 00:00:00 2001 From: Dan Horák Date: Jan 18 2017 08:57:02 +0000 Subject: [PATCH 2/3] koji-shadow: remove authca, it's not used for ssl_login any more --- diff --git a/util/koji-shadow b/util/koji-shadow index c1d192b..9442fa8 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 1120c525206ff7f924514ee673e638a9b12af1b5 Mon Sep 17 00:00:00 2001 From: Dan Horák Date: Jan 21 2017 18:53:49 +0000 Subject: [PATCH 3/3] koji-shadow: fix log() invocation --- diff --git a/util/koji-shadow b/util/koji-shadow index 9442fa8..39c63d9 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():