Skip to content

Commit

Permalink
Merge pull request #232 from fstagni/checkSecDir
Browse files Browse the repository at this point in the history
fix: give priority to CVMFS locations
  • Loading branch information
fstagni committed Feb 27, 2024
2 parents d5ab0d2 + 222868d commit 37e5a3c
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions Pilot/pilotTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,31 +1029,28 @@ def __init__(self):

def __checkSecurityDir(self, envName, dirName):

# try and find it
for candidate in self.CVMFS_locations:
candidateDir = os.path.join(candidate,
'etc/grid-security',
dirName)
self.log.debug(
"Candidate directory for %s is %s"
% (envName, candidateDir)
)
if safe_listdir(candidateDir):
self.log.debug("Setting %s=%s" % (envName, candidateDir))
self.installEnv[envName] = candidateDir
os.environ[envName] = candidateDir
return
self.log.debug("%s not found or not a directory" % candidateDir)

if envName in os.environ and safe_listdir(os.environ[envName]):
self.log.debug(
"%s is set in the host environment as %s, aligning installEnv to it"
% (envName, os.environ[envName])
)
self.installEnv[envName] = os.environ[envName]
)
else:
self.log.debug("%s is not set in the host environment" % envName)
# try and find it
for candidate in self.CVMFS_locations:
candidateDir = os.path.join(candidate,
'etc/grid-security',
dirName)
self.log.debug(
"Candidate directory for %s is %s"
% (envName, candidateDir)
)
if safe_listdir(candidateDir):
self.log.debug("Setting %s=%s" % (envName, candidateDir))
self.installEnv[envName] = candidateDir
os.environ[envName] = candidateDir
break
self.log.debug("%s not found or not a directory" % candidateDir)

if envName not in self.installEnv:
self.log.error("Could not find/set %s" % envName)
sys.exit(1)

Expand Down

0 comments on commit 37e5a3c

Please sign in to comment.