Skip to content

Commit

Permalink
use py3 version of Rucio. Fix #4966 (#5151)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Feb 9, 2022
1 parent aa4374f commit 6c9ac83
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/python/CRABClient/Commands/checkwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def __call__(self):
else:
self.logger.info("LFN %s is valid.", self.lfnPrefix)

# we need Rucio to check LFN to PFN, but it does not exist in CC6 singularity image
# where there is no python3. And in any case Rucio will not support python2 in the future
if not cmd_exist("python3"):
self.logger.info("No python3. Not possible to use Rucio in this environment")
return {'status': 'FAILED'}

cp_cmd = ""
if cmd_exist("gfal-copy") and cmd_exist("gfal-rm") and self.command in [None, "GFAL"]:
self.logger.info("Will use `gfal-copy`, `gfal-rm` commands for checking write permissions")
Expand Down Expand Up @@ -192,8 +198,9 @@ def getPFN(self, site='T2_CH_CERN', lfn='/store/user', username='jdoe'):
with open(scriptName, 'w') as ofile:
ofile.write(rucioScript)
cmd = 'eval `scram unsetenv -sh`; '
cmd += 'source /cvmfs/cms.cern.ch/rucio/setup.sh 2>/dev/null; export RUCIO_ACCOUNT=%s; ' % username
cmd += 'python %s; ' % scriptName
cmd += 'source /cvmfs/cms.cern.ch/rucio/setup-py3.sh 2>/dev/null; '
cmd += 'export RUCIO_ACCOUNT=%s; ' % username
cmd += 'python3 %s; ' % scriptName
rucioOut, rucioErr, exitcode = execute_command(cmd)
os.unlink(scriptName)
if exitcode:
Expand Down

0 comments on commit 6c9ac83

Please sign in to comment.