Skip to content

Commit

Permalink
respect CRAB3_CACHE_FILE=/dev/null Fix #5337 (#5338)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Oct 25, 2024
1 parent 60df7e3 commit d145700
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/python/CRABClient/Commands/SubCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ def getConfiDict(self):
Load the CRAB cache file (~/.crab3). If it doesn't exist, create one.
"""
crabCacheFileName = self.crabcachepath()
if '/dev/null' in crabCacheFileName:
configdict = {'crab_project_directory': ''}
return configdict
if not os.path.isfile(crabCacheFileName):
msg = "Could not find CRAB cache file %s; creating a new one." % (crabCacheFileName)
self.logger.debug(msg)
Expand Down Expand Up @@ -606,6 +609,8 @@ def updateCRABCacheFile(self):
if self.cmdconf['requiresDirOption'] or getattr(self, 'requestarea', None):
self.crab3dic['crab_project_directory'] = self.requestarea
crabCacheFileName = self.crabcachepath()
if '/dev/null' in crabCacheFileName:
return
crabCacheFileName_tmp = "%s.%s" % (crabCacheFileName, os.getpid())
with open(crabCacheFileName_tmp, 'w') as fd:
json.dump(self.crab3dic, fd)
Expand Down

0 comments on commit d145700

Please sign in to comment.