Allow builder to attempt krb if gssapi is available

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2019-05-29 17:31:52 +02:00 committed by Mike McLean
parent badb40d5f8
commit 184fbf02f4

View file

@ -68,6 +68,11 @@ try:
except ImportError: # pragma: no cover
krbV = None
try:
import requests_kerberos
except ImportError: # pragma: no cover
requests_kerberos = None
try:
import librepo
import io
@ -6264,7 +6269,7 @@ if __name__ == "__main__":
quit("Error: Unable to log in. Bad credentials?")
except six.moves.xmlrpc_client.ProtocolError:
quit("Error: Unable to connect to server %s" % (options.server))
elif krbV:
elif krbV or requests_kerberos:
krb_principal = options.krb_principal
if krb_principal is None:
krb_principal = options.host_principal_format % socket.getfqdn()