remove deprecated krbV support

Fixes: https://pagure.io/koji/issue/1991
This commit is contained in:
Tomas Kopecek 2020-05-13 16:36:32 +02:00 committed by Mike McLean
parent ee93da4177
commit f8419e3626
25 changed files with 30 additions and 552 deletions

View file

@ -20,11 +20,6 @@ import koji
from koji import parse_arches
from koji.util import md5_constructor, to_list
try:
import krbV
except ImportError: # pragma: no cover
krbV = None
# for compatibility with plugins based on older version of lib
# Use optparse imports directly in new code.
@ -663,18 +658,6 @@ def warn(msg):
sys.stderr.flush()
def has_krb_creds():
if krbV is None:
return False
try:
ctx = krbV.default_context()
ccache = ctx.default_ccache()
ccache.principal()
return True
except krbV.Krb5Error:
return False
def activate_session(session, options):
"""Test and login the session is applicable"""
if isinstance(options, dict):
@ -692,7 +675,7 @@ def activate_session(session, options):
and options.authtype is None:
# authenticate using user/password
session.login()
elif options.authtype == "kerberos" or has_krb_creds() and options.authtype is None:
elif options.authtype == "kerberos" or options.authtype is None:
try:
if getattr(options, 'keytab', None) and getattr(options, 'principal', None):
session.gssapi_login(principal=options.principal, keytab=options.keytab,