Skip to content

Commit

Permalink
Merge pull request #225 from fstagni/guess_location
Browse files Browse the repository at this point in the history
Guess location of CVMFS deployed installation
  • Loading branch information
fstagni authored Jan 17, 2024
2 parents d7da5b0 + 4a7d863 commit d7a8ce3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Pilot/pilotCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,22 @@ def _getPreinstalledEnvScript(self):

self.log.debug("self.pp.preinstalledEnv = %s" % self.pp.preinstalledEnv)
self.log.debug("self.pp.preinstalledEnvPrefix = %s" % self.pp.preinstalledEnvPrefix)
self.log.debug("self.pp.CVMFS_locations = %s" % self.pp.CVMFS_locations)

preinstalledEnvScript = self.pp.preinstalledEnv
if not preinstalledEnvScript and self.pp.preinstalledEnvPrefix:
version = self.pp.releaseVersion or "pro"
arch = platform.system() + "-" + platform.machine()
preinstalledEnvScript = os.path.join(self.pp.preinstalledEnvPrefix, version, arch, "diracosrc")

if not preinstalledEnvScript and self.pp.CVMFS_locations:
for CVMFS_location in self.pp.CVMFS_locations:
version = self.pp.releaseVersion or "pro"
arch = platform.system() + "-" + platform.machine()
preinstalledEnvScript = os.path.join(CVMFS_location, self.pp.releaseProject.lower() + "dirac", version, arch, "diracosrc")
if os.path.isfile(preinstalledEnvScript):
break

self.log.debug("preinstalledEnvScript = %s" % preinstalledEnvScript)

if preinstalledEnvScript:
Expand Down
3 changes: 3 additions & 0 deletions Pilot/pilotTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ def __init__(self):
("", "pilotUUID=", "pilot UUID"),
("", "preinstalledEnv=", "preinstalled pilot environment script location"),
("", "preinstalledEnvPrefix=", "preinstalled pilot environment area prefix"),
("", "CVMFS_locations=", "comma-separated list of CVMS locations"),
)

# Possibly get Setup and JSON URL/filename from command line
Expand Down Expand Up @@ -1112,6 +1113,8 @@ def __initCommandLine2(self):
self.preinstalledEnv = v
elif o == "--preinstalledEnvPrefix":
self.preinstalledEnvPrefix = v
elif o == "--CVMFS_locations":
self.CVMFS_locations = v.split(",")

def __loadJSON(self):
"""
Expand Down

0 comments on commit d7a8ce3

Please sign in to comment.