Skip to content

Commit

Permalink
Merge pull request #198 from aldbr/master_feat_tagsPassedOnlyOnce
Browse files Browse the repository at this point in the history
devel: pass tags to the Pilot config only once
  • Loading branch information
fstagni authored Nov 6, 2023
2 parents 05ac082 + 98722dc commit 0c37f3b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Pilot/pilotCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,23 +740,21 @@ def execute(self):
self.log.error("The pilot command output is not json compatible.")
self.exitWithError(1)

self.pp.queueParameters = resourceDict
for queueParamName, queueParamValue in self.pp.queueParameters.items():
if isinstance(queueParamValue, list): # for the tags
queueParamValue = ",".join([str(qpv).strip() for qpv in queueParamValue])
self.cfg.append("-o /LocalSite/%s=%s" % (queueParamName, quote(queueParamValue)))

# Pick up all the relevant resource parameters that will be used in the job matching
if "WholeNode" in resourceDict:
self.pp.tags.append("WholeNode")

# Tags must be added to already defined tags if any
if resourceDict.get("Tag"):
self.pp.tags += resourceDict["Tag"]
self.pp.tags += resourceDict.pop("Tag", [])

# RequiredTags are like Tags.
if resourceDict.get("RequiredTag"):
self.pp.reqtags += resourceDict["RequiredTag"]
self.pp.reqtags += resourceDict.pop("RequiredTag", [])

self.pp.queueParameters = resourceDict
for queueParamName, queueParamValue in self.pp.queueParameters.items():
if isinstance(queueParamValue, list): # for the tags
queueParamValue = ",".join([str(qpv).strip() for qpv in queueParamValue])
self.cfg.append("-o /LocalSite/%s=%s" % (queueParamName, quote(queueParamValue)))

if self.cfg:
if self.pp.localConfigFile:
Expand Down

0 comments on commit 0c37f3b

Please sign in to comment.