]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
fix bug in jobs command when multiple files are called
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 4 Jan 2017 14:57:30 +0000 (15:57 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 4 Jan 2017 14:57:30 +0000 (15:57 +0100)
commands/jobs.py

index 07be864e62385fa8702283eb6b76f43a703ceb15..14dfb945fc5cc5a94b982e2df5994f04327b76b1 100644 (file)
@@ -1698,11 +1698,20 @@ def run(args, runner, logger):
                 l_jb.append(jb,
                 "Adding a job that was given in only_jobs option parameters")
         config_jobs.jobs = l_jb
-     
+    
+    # Make a unique file that contain all the jobs in order to use it 
+    # on every machine
+    name_pyconf = "_".join([os.path.basename(path)[:-len('.pyconf')] 
+                            for path in l_conf_files_path]) + ".pyconf"
+    path_pyconf = src.get_tmp_filename(runner.cfg, name_pyconf)
+    #Save config
+    f = file( path_pyconf , 'w')
+    config_jobs.__save__(f)
+    
     # Initialization
     today_jobs = Jobs(runner,
                       logger,
-                      file_jobs_cfg,
+                      path_pyconf,
                       config_jobs)
     # SSH connection to all machines
     today_jobs.ssh_connection_all_machines()
@@ -1787,4 +1796,7 @@ def run(args, runner, logger):
                 today_jobs.gui.last_update()
         # Output the results
         today_jobs.write_all_results()
+        # Remove the temporary pyconf file
+        if os.path.exists(path_pyconf):
+            os.remove(path_pyconf)
         return res