#2735 lib: more verbose conn AuthError for ssl/gssapi
Merged a year ago by tkopecek. Opened a year ago by tkopecek.
tkopecek/koji issue2502  into  master

file modified
+16 -3
@@ -2514,6 +2514,7 @@ 

          old_env = {}

          old_opts = self.opts

          self.opts = old_opts.copy()

+         e_str = None

          try:

              # temporary timeout value during login

              self.opts['timeout'] = self.opts.get('auth_timeout',
@@ -2541,7 +2542,8 @@ 

                  sinfo = self._callMethod('sslLogin', [proxyuser], retry=False)

              except Exception as e:

                  e_str = ''.join(traceback.format_exception_only(type(e), e))

-                 self.logger.debug('gssapi auth failed: %s', e_str)

+                 e_str = 'gssapi auth failed: %s' % e_str

+                 self.logger.debug(e_str)

                  # Auth with https didn't work. Restore for the next attempt.

                  self.baseurl = old_baseurl

          finally:
@@ -2552,7 +2554,10 @@ 

                  else:

                      os.environ[key] = old_env[key]

          if not sinfo:

-             raise AuthError('unable to obtain a session')

+             err = 'unable to obtain a session'

+             if e_str:

+                 err += ' (%s)' % e_str

+             raise AuthError(err)

  

          self.setSession(sinfo)

  
@@ -2586,12 +2591,20 @@ 

                                               DEFAULT_AUTH_TIMEOUT)

          self.opts['cert'] = cert

          self.opts['serverca'] = serverca

+         e_str = None

          try:

              sinfo = self.callMethod('sslLogin', proxyuser)

+         except Exception as ex:

+             e_str = ''.join(traceback.format_exception_only(type(ex), ex))

+             e_str = 'ssl auth failed: %s' % e_str

+             self.logger.debug(e_str)

          finally:

              self.opts = old_opts

          if not sinfo:

-             raise AuthError('unable to obtain a session')

+             err = 'unable to obtain a session'

+             if e_str:

+                 err += ' (%s)' % e_str

+             raise AuthError(err)

  

          self.opts['cert'] = cert

          self.opts['serverca'] = serverca

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

a year ago

is it e_str = 'ssl auth failed: %s' % e_str ?

rebased onto 7ed0124

a year ago

pretty please pagure-ci rebuild

a year ago

pretty please pagure-ci rebuild

a year ago

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

a year ago

Commit 217704f fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago