Skip to content

Commit

Permalink
converting exception to string in rucio/rucio-admin exception handler r…
Browse files Browse the repository at this point in the history
  • Loading branch information
gumond committed May 19, 2020
1 parent a93710b commit 66e9c35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/rucio
Expand Up @@ -202,7 +202,7 @@ def exception_handler(function):
logger.debug('This means one dependency is missing.')
return error.error_code
except KeyError as error:
if 'x-rucio-auth-token' in error:
if 'x-rucio-auth-token' in str(error):
used_account = None
try: # get the configured account from the configuration file
used_account = '%s (from rucio.cfg)' % config_get('client', 'account')
Expand Down Expand Up @@ -278,7 +278,7 @@ def get_client(args):
user_agent=args.user_agent)
except CannotAuthenticate as error:
logger.error(error)
if 'alert certificate expired' in error:
if 'alert certificate expired' in str(error):
logger.error('The server certificate expired.')
elif auth_type.lower() == 'x509_proxy':
logger.error('Please verify that your proxy is still valid and renew it if needed.')
Expand Down
2 changes: 1 addition & 1 deletion bin/rucio-admin
Expand Up @@ -236,7 +236,7 @@ def get_client(args):
ca_cert=args.ca_certificate, timeout=args.timeout)
except CannotAuthenticate as error:
logger.error(error)
if 'alert certificate expired' in error:
if 'alert certificate expired' in str(error):
logger.error('The server certificate expired.')
elif auth_type.lower() == 'x509_proxy':
logger.error('Please verify that your proxy is still valid and renew it if needed.')
Expand Down

0 comments on commit 66e9c35

Please sign in to comment.