Skip to content

Commit f8ce0b8

Browse files
authored
do not crash on Rucio unavailable. Fix #5298 (#5302)
1 parent 0a267d7 commit f8ce0b8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/python/CRABClient/Commands/SubCommand.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,17 @@ def __init__(self, logger, cmdargs=None, disable_interspersed_args=False):
384384
if self.cmdconf['requiresRucio']:
385385
if os.environ.get('RUCIO_HOME', None):
386386
username = getUsername(self.proxyfilename, logger=self.logger)
387-
from rucio.client import Client
388-
os.environ['RUCIO_ACCOUNT'] = username
389-
self.rucio = Client()
390-
me = self.rucio.whoami()
391-
self.logger.info('Rucio client intialized for account %s' % me['account'])
387+
try:
388+
from rucio.client import Client
389+
from rucio.common.exception import RucioException
390+
os.environ['RUCIO_ACCOUNT'] = username
391+
self.rucio = Client()
392+
me = self.rucio.whoami()
393+
self.logger.info('Rucio client intialized for account %s' % me['account'])
394+
except RucioException as ex:
395+
self.logger.info('Rucio client could not be intialized, some funcionalities may not work')
396+
self.logger.debug('Rucio exception message: %s', ex)
397+
self.Rucio = None
392398
else:
393399
self.rucio = None
394400

0 commit comments

Comments
 (0)