From c349946718811e0f5291f0d7358b662b1a3e025b Mon Sep 17 00:00:00 2001 From: Brendan Reilly Date: Tue, 7 Jan 2020 15:59:36 -0500 Subject: [PATCH] use gssapi if correct python-requests-kerberos is available --- module_build_service/builder/KojiModuleBuilder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module_build_service/builder/KojiModuleBuilder.py b/module_build_service/builder/KojiModuleBuilder.py index e42477b0..800a9719 100644 --- a/module_build_service/builder/KojiModuleBuilder.py +++ b/module_build_service/builder/KojiModuleBuilder.py @@ -496,17 +496,17 @@ class KojiModuleBuilder(GenericBuilder): if authtype == "kerberos": try: import krbV + # We want to create a context per thread to avoid Kerberos cache corruption + ctx = krbV.Context() except ImportError: - raise RuntimeError( - "python-krbV must be installed to authenticate with Koji using Kerberos") + # If no krbV, we can assume GSSAPI auth is available + ctx = None keytab = getattr(config, "krb_keytab", None) principal = getattr(config, "krb_principal", None) if not keytab and principal: raise ValueError( "The Kerberos keytab and principal aren't set for Koji authentication") log.debug(" keytab: %r, principal: %r" % (keytab, principal)) - # We want to create a context per thread to avoid Kerberos cache corruption - ctx = krbV.Context() # We want to use the thread keyring for the ccache to ensure we have one cache per # thread to avoid Kerberos cache corruption ccache = "KEYRING:thread:mbs"