Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Pilot/pilotCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def execute(self):

try:
# In case we want to force local installation (in absence of CVMFS or for test reasons)
if "diracInstallOnly" in self.pp.genericOption:
if "diracInstallOnly" in self.pp.genericOptions:
self.log.info("NOT sourcing: starting traditional DIRAC installation")
self._localInstallDIRAC()
return
Expand All @@ -397,7 +397,7 @@ def execute(self):

except OSError as e:
self.log.error("Exception when trying to source the DIRAC environment: %s" % str(e))
if "cvmfsOnly" in self.pp.genericOption:
if "cvmfsOnly" in self.pp.genericOptions:
self.exitWithError(1)
self.log.warn("Source of the DIRAC environment NOT DONE: starting traditional DIRAC installation")
self._localInstallDIRAC()
Expand Down Expand Up @@ -759,9 +759,8 @@ def execute(self):
if self.pp.ceType:
self.cfg.append("-o /LocalSite/LocalCE=%s" % self.pp.ceType)

for o, v in self.pp.optList:
if o == "-o" or o == "--option":
self.cfg.append('-o "%s"' % v)
for genericOption in self.pp.genericOptions:
self.cfg.append('-o "%s"' % genericOption)

if self.pp.pilotReference:
self.cfg.append("-o /LocalSite/PilotReference=%s" % self.pp.pilotReference)
Expand Down
4 changes: 2 additions & 2 deletions Pilot/pilotTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def __init__(self):
self.gateway = ""
self.useServerCertificate = False
self.pilotScriptName = ""
self.genericOption = ""
self.genericOptions = []
self.wnVO = "" # for binding the resource (WN) to a specific VO
# Some commands can define environment necessary to execute subsequent commands
self.installEnv = os.environ
Expand Down Expand Up @@ -1206,7 +1206,7 @@ def __initCommandLine2(self):
elif o == "--pilotUUID":
self.pilotUUID = v
elif o in ("-o", "--option"):
self.genericOption = v
self.genericOptions.append(v)
elif o in ("-t", "--tag"):
self.tags.append(v)
elif o == "--requiredTag":
Expand Down
12 changes: 12 additions & 0 deletions Pilot/tests/Test_Pilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ def test_InitJSON(self):
self.assertEqual(pp.commandOptions["b"], "2")
self.assertEqual(pp.commandOptions["c"], "3")

sys.argv[1:] = [
"--Name",
"grid1.example.com",
"--option",
"diracInstallOnly",
"-o",
"/LocalSite/Example=value",
]
pp = PilotParams()

self.assertEqual(pp.genericOptions, ["diracInstallOnly", "/LocalSite/Example=value"])

sys.argv[1:] = [
"--Name",
"grid1.example.com",
Expand Down
Loading