From dc3240276f955709b2d31866f9ad65f231944b4f Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 20 Jan 2010 14:06:42 +0000 Subject: [PATCH] - Adding PATH and PYTHONPATH of workdirectory in job environnement --- src/Launcher/Launcher_Job_Command.cxx | 4 ++-- src/Launcher/Launcher_Job_SALOME.cxx | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Launcher/Launcher_Job_Command.cxx b/src/Launcher/Launcher_Job_Command.cxx index 313a0b026..fa33a2363 100644 --- a/src/Launcher/Launcher_Job_Command.cxx +++ b/src/Launcher/Launcher_Job_Command.cxx @@ -42,8 +42,6 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l std::string work_directory = params[WORKDIR].str(); // File name - std::string::size_type p1 = _job_file.find_last_of("/"); - std::string launch_date_port_file = launch_date; std::string launch_script = "/tmp/runCommand_" + _job_file_name + "_" + launch_date + ".sh"; std::ofstream launch_script_stream; @@ -52,6 +50,8 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l // Script launch_script_stream << "#! /bin/sh -f" << std::endl; launch_script_stream << "cd " << work_directory << std::endl; + launch_script_stream << "export PYTHONPATH=" << work_directory << ":$PYTHONPATH" << std::endl; + launch_script_stream << "export PATH=" << work_directory << ":$PATH" << std::endl; if (_env_file != "") { std::string::size_type last = _env_file.find_last_of("/"); diff --git a/src/Launcher/Launcher_Job_SALOME.cxx b/src/Launcher/Launcher_Job_SALOME.cxx index 84ab93569..0555a3807 100644 --- a/src/Launcher/Launcher_Job_SALOME.cxx +++ b/src/Launcher/Launcher_Job_SALOME.cxx @@ -61,6 +61,8 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params) // Begin of script launch_script_stream << "#! /bin/sh -f" << std::endl; launch_script_stream << "cd " << work_directory << std::endl; + launch_script_stream << "export PYTHONPATH=" << work_directory << ":$PYTHONPATH" << std::endl; + launch_script_stream << "export PATH=" << work_directory << ":$PATH" << std::endl; if (_env_file != "") { std::string::size_type last = _env_file.find_last_of("/"); -- 2.39.2