diff --git a/src/DIRAC/Interfaces/API/Job.py b/src/DIRAC/Interfaces/API/Job.py index 1baba96000d..641bdc932ad 100755 --- a/src/DIRAC/Interfaces/API/Job.py +++ b/src/DIRAC/Interfaces/API/Job.py @@ -93,7 +93,16 @@ def __init__(self, script=None, stdout="std.out", stderr="std.err"): ############################################################################# - def setExecutable(self, executable, arguments="", logFile="", modulesList=None, parameters=None, paramValues=None): + def setExecutable( + self, + executable, + arguments="", + logFile="", + modulesList=None, + parameters=None, + paramValues=None, + includeInSandbox=True, + ): """Helper function. Specify executable script to run with optional arguments and log file @@ -118,17 +127,18 @@ def setExecutable(self, executable, arguments="", logFile="", modulesList=None, :type parameters: python:list of tuples :param paramValues: Optional list of parameters values (to be used mostly when extending this method) :type parameters: python:list of tuples + :param bool includeInSandbox: flag to include the executable in the input sandbox (default: True) """ kwargs = {"executable": executable, "arguments": arguments, "logFile": logFile} if not isinstance(executable, str) or not isinstance(arguments, str) or not isinstance(logFile, str): return self._reportError("Expected strings for executable and arguments", **kwargs) - if os.path.exists(executable): + if includeInSandbox and os.path.exists(executable): self.log.verbose(f"Found script executable file {executable}") self.addToInputSandbox.append(executable) logName = f"{os.path.basename(executable)}.log" else: - self.log.warn("The executable code could not be found locally") + self.log.verbose("The executable code is not local") logName = "CodeOutput.log" self.stepCount += 1