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

@ -69,12 +69,6 @@ from koji.tasks import (
)
from koji.util import dslice, dslice_ex, isSuccess, parseStatus, to_list
try:
import krbV
Krb5Error = krbV.Krb5Error
except ImportError: # pragma: no cover
krbV = None
try:
import requests_kerberos
Krb5Error = requests_kerberos.exceptions.RequestException
@ -6454,10 +6448,6 @@ def get_options():
'host_principal_format': 'compile/%s@EXAMPLE.COM',
'keytab': '/etc/kojid/kojid.keytab',
'ccache': '/var/tmp/kojid.ccache',
'krbservice': 'host',
'krb_rdns': True,
'krb_canon_host': False,
'krb_server_realm': None,
'server': None,
'user': None,
'password': None,
@ -6501,8 +6491,7 @@ def get_options():
quit("value for %s option must be a valid integer" % name)
elif name in ['offline_retry', 'use_createrepo_c', 'createrepo_skip_stat',
'createrepo_update', 'use_fast_upload', 'support_rpm_source_layout',
'krb_rdns', 'krb_canon_host', 'build_arch_can_fail', 'no_ssl_verify',
'log_timestamps']:
'build_arch_can_fail', 'no_ssl_verify', 'log_timestamps']:
defaults[name] = config.getboolean('kojid', name)
elif name in ['plugin', 'plugins']:
defaults['plugin'] = value.split()
@ -6608,14 +6597,14 @@ if __name__ == "__main__":
quit("Error: Unable to log in. Bad credentials?")
except requests.exceptions.ConnectionError:
quit("Error: Unable to connect to server %s" % (options.server))
elif krbV or requests_kerberos:
elif requests_kerberos:
krb_principal = options.krb_principal
if krb_principal is None:
krb_principal = options.host_principal_format % socket.getfqdn()
try:
session.krb_login(principal=krb_principal,
keytab=options.keytab,
ccache=options.ccache)
session.gssapi_login(principal=krb_principal,
keytab=options.keytab,
ccache=options.ccache)
except Krb5Error as e:
quit("Kerberos authentication failed: %s" % e.args)
except socket.error as e: