]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Bug fix: option "--shutdown-server" is now implemented in Cedric's new SALOME runner.
authorAdrien Bruneton <adrien.bruneton@cea.fr>
Wed, 12 Feb 2014 13:34:45 +0000 (14:34 +0100)
committerAdrien Bruneton <adrien.bruneton@cea.fr>
Wed, 12 Feb 2014 13:34:45 +0000 (14:34 +0100)
This prevents random bugs with the option, when the killSalome logic was
called at a time where Python was already half shut down.

bin/salomeRunner.py

index 5be7955a7230b64e27b926c401eaa68a07854914..f92c206a274e41c8eadba9ca0bf5584fa7e8e9be 100644 (file)
@@ -84,9 +84,17 @@ class SalomeRunner:
   def go(self, args):
     # Run this module as a script, in order to use appropriate Python interpreter
     # according to current path (initialized from environment files).
+    kill = False
+    for e in args:
+      if "--shutdown-server" in e:
+        kill = True
+        args.remove(e)
+    
     absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
     proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","salomeRunner.py"), pickle.dumps(self),  pickle.dumps(args)], shell=False, close_fds=True)
     proc.communicate()
+    if kill:
+      self._killAll(args)
   #
 
   """Append value to PATH environment variable"""