#9 Authenticate to Koji using activate_session
Opened 4 months ago by puiterwijk. Modified 4 months ago
puiterwijk/sigul koji_activate_session  into  master

file modified
+2 -11
@@ -304,23 +304,14 @@ 

      # NSS_NoDB_Init() during its initialization, which breaks our attempts to

      # initialize nss with our certificate database.

      import koji

+     import koji_cli.lib

  

      opts = {}

      opts['krb_rdns'] = koji_config.get('krb_rdns', 'no').lower() in ('yes',

                                                                       'true')

  

      session = koji.ClientSession(koji_config['server'], opts=opts)

-     if authenticate:

-         if koji_config['authtype'] == 'ssl':

-             session.ssl_login(koji_config['cert'], None,

-                               koji_config.get('serverca'), proxyuser=proxyuser)

-         elif koji_config['authtype'] == 'kerberos':

-             kwargs = {}

-             for opt in ('principal', 'keytab', 'ccache'):

-                 if opt in koji_config:

-                     kwargs[opt] = koji_config[opt]

- 

-             session.krb_login(proxyuser=proxyuser, **kwargs)

+     koji_cli.lib.activate_session(session, koji_config)

      try:

          version = session.getAPIVersion()

      except xmlrpc_client.ProtocolError:

Fixes: #4
Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org

This pull request is an initial draft and needs testing.

Metadata