#1613 Allow builder to attempt krb if gssapi is available
Merged 2 years ago by mikem. Opened 2 years ago by tkopecek.
tkopecek/koji issue1468  into  master

file modified
+10 -3
@@ -65,10 +65,17 @@ 

  

  try:

      import krbV

+     Krb5Error = krbV.Krb5Error

  except ImportError:  # pragma: no cover

      krbV = None

  

  try:

+     import requests_kerberos

+     Krb5Error = requests_kerberos.exceptions.RequestException

+ except ImportError:  # pragma: no cover

+     requests_kerberos = None

+ 

+ try:

      import librepo

      import io

  except ImportError:
@@ -6264,7 +6271,7 @@ 

              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()
@@ -6272,8 +6279,8 @@ 

              session.krb_login(principal=krb_principal,

                                keytab=options.keytab,

                                ccache=options.ccache)

-         except krbV.Krb5Error as e:

-             quit("Kerberos authentication failed: '%s' (%s)" % (e.args[1], e.args[0]))

+         except Krb5Error as e:

+             quit("Kerberos authentication failed: %s" % e.args)

          except socket.error as e:

              quit("Could not connect to Kerberos authentication service: '%s'" % e.args[1])

      else:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

2 new commits added

  • fix krbV error handling
  • Allow builder to attempt krb if gssapi is available
2 years ago

Commit 0700e49 fixes this pull-request

Pull-Request has been merged by mikem

2 years ago