Use requests_gssapi instead of requests_kerberos
Retain ability to use the old requests_kerberos where request_gssapi is not available yet. Signed-off-by: Simo Sorce <simo@redhat.com>
This commit is contained in:
parent
9063f33b07
commit
2c663f0b73
7 changed files with 36 additions and 25 deletions
|
|
@ -70,10 +70,14 @@ from koji.tasks import (
|
|||
from koji.util import dslice, dslice_ex, isSuccess, parseStatus, to_list
|
||||
|
||||
try:
|
||||
import requests_kerberos
|
||||
Krb5Error = requests_kerberos.exceptions.RequestException
|
||||
import requests_gssapi as reqgssapi
|
||||
Krb5Error = reqgssapi.exceptions.RequestException
|
||||
except ImportError: # pragma: no cover
|
||||
requests_kerberos = None
|
||||
try:
|
||||
import requests_kerberos as reqgssapi
|
||||
Krb5Error = reqgssapi.exceptions.RequestException
|
||||
except ImportError: # pragma: no cover
|
||||
reqgssapi = None
|
||||
|
||||
try:
|
||||
import librepo
|
||||
|
|
@ -6597,7 +6601,7 @@ 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 requests_kerberos:
|
||||
elif reqgssapi:
|
||||
krb_principal = options.krb_principal
|
||||
if krb_principal is None:
|
||||
krb_principal = options.host_principal_format % socket.getfqdn()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue