From f95d361f61c42fc8844e8ab649b7da9efa2e854c Mon Sep 17 00:00:00 2001 From: fstagni Date: Thu, 3 Dec 2020 18:09:01 +0100 Subject: [PATCH 1/2] set DIRACSYSCONFIG env variable to pilot.cfg --- Pilot/dirac-install.py | 4 +++- Pilot/pilotCommands.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Pilot/dirac-install.py b/Pilot/dirac-install.py index a5080cdd..f0c705e0 100755 --- a/Pilot/dirac-install.py +++ b/Pilot/dirac-install.py @@ -2192,7 +2192,9 @@ def createBashrc(): if cliParams.userEnvVariables: lines.extend(['# User-requested variables']) for envName, envValue in cliParams.userEnvVariables.items(): - lines.extend(['export %s=%s' % (envName, envValue)]) + lines.extend(['( echo $%s | grep -q $%s ) || export %s=$%s:$%s' % ( + envName, envValue, + envName, envName, envValue)]) # Add possible DIRAC environment variables lines.append('') diff --git a/Pilot/pilotCommands.py b/Pilot/pilotCommands.py index 41070941..14c2e9ff 100644 --- a/Pilot/pilotCommands.py +++ b/Pilot/pilotCommands.py @@ -154,6 +154,8 @@ def __init__(self, pilotParams): self.pp.rootPath = self.pp.pilotRootPath self.installScriptName = 'dirac-install.py' self.installScript = '' + # This command is a "must-do", so it's assumed that the variable below is set + self.pp.installEnv['DIRACSYSCONFIG'] = 'pilot.cfg' def _setInstallOptions(self): """ Setup installation parameters @@ -929,7 +931,6 @@ def __setInnerCEOpts(self): # The file pilot.cfg has to be created previously by ConfigureDIRAC if self.pp.localConfigFile: - self.innerCEOpts.append(' -o /AgentJobRequirements/ExtraOptions=%s' % self.pp.localConfigFile) if LooseVersion(self.pp.releaseVersion) >= self.cfgOptionDIRACVersion: self.innerCEOpts.append('--cfg') self.innerCEOpts.append(self.pp.localConfigFile) @@ -1032,7 +1033,6 @@ def __setInProcessOpts(self): # The file pilot.cfg has to be created previously by ConfigureDIRAC if self.pp.localConfigFile: - self.inProcessOpts.append(' -o /AgentJobRequirements/ExtraOptions=%s' % self.pp.localConfigFile) if LooseVersion(self.pp.releaseVersion) >= self.cfgOptionDIRACVersion: self.inProcessOpts.append('--cfg') self.inProcessOpts.append(self.pp.localConfigFile) From 4f8bf9c8e4c9655dea83b22ed1ba74a587a60439 Mon Sep 17 00:00:00 2001 From: fstagni Date: Tue, 5 Jan 2021 12:59:44 +0100 Subject: [PATCH 2/2] restore --- Pilot/dirac-install.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Pilot/dirac-install.py b/Pilot/dirac-install.py index f0c705e0..a5080cdd 100755 --- a/Pilot/dirac-install.py +++ b/Pilot/dirac-install.py @@ -2192,9 +2192,7 @@ def createBashrc(): if cliParams.userEnvVariables: lines.extend(['# User-requested variables']) for envName, envValue in cliParams.userEnvVariables.items(): - lines.extend(['( echo $%s | grep -q $%s ) || export %s=$%s:$%s' % ( - envName, envValue, - envName, envName, envValue)]) + lines.extend(['export %s=%s' % (envName, envValue)]) # Add possible DIRAC environment variables lines.append('')