From 98722dcb878b1b50e4acb191546fcaf4f2855fee Mon Sep 17 00:00:00 2001 From: aldbr Date: Mon, 10 Jul 2023 09:42:23 +0200 Subject: [PATCH] feat: pass tags only once in the Pilot config --- Pilot/pilotCommands.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Pilot/pilotCommands.py b/Pilot/pilotCommands.py index b4d98995..66f0c282 100644 --- a/Pilot/pilotCommands.py +++ b/Pilot/pilotCommands.py @@ -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: