]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Some fixes on salome kill.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 17 Sep 2019 15:42:51 +0000 (17:42 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 17 Sep 2019 15:42:51 +0000 (17:42 +0200)
bin/killSalomeWithPort.py
bin/salomeContext.py
src/Launcher/Test/test_launcher.py

index 4c6651a6a044b5afd8cc3ab9cc7a882acc354944..7417f18994125fa94ed2edf0949a6ceda94925e5 100755 (executable)
@@ -342,7 +342,7 @@ def cleanApplication(port):
 
     try:
         filedict=getPiDict(port)
-        os.remove(filedict)
+        __killMyPort(port, filedict)
     except:
       #import traceback
       #traceback.print_exc()
index ae0267c9d78f6eb794f4d3a8f08f33a33fc24a22..37b3c9f31c2060a1955341f7f226fb8ae7bdcc9c 100755 (executable)
@@ -396,31 +396,32 @@ class SalomeContext:
       print("Port number(s) not provided to command: salome kill <port(s)>")
       return 1
 
-    from multiprocessing import Process
-    from killSalomeWithPort import killMyPort
-    import tempfile
+    import subprocess
+    import setenv
+    setenv.main(True)
+    if os.getenv("NSHOST") == "no_host":
+      os.unsetenv("NSHOST")
     for port in ports:
-      with tempfile.NamedTemporaryFile():
-        p = Process(target = killMyPort, args=(port,))
-        p.start()
-        p.join()
+      proc = subprocess.Popen(["killSalomeWithPort.py", port])
+      proc.communicate()
+
     return 0
   #
 
   def _killAll(self, unused=None):
+    import setenv
+    setenv.main(True)
+    if os.getenv("NSHOST") == "no_host":
+      os.unsetenv("NSHOST")
     try:
       import PortManager # mandatory
-      from multiprocessing import Process
-      from killSalomeWithPort import killMyPort
+      import subprocess
       ports = PortManager.getBusyPorts()['this']
 
       if ports:
-        import tempfile
         for port in ports:
-          with tempfile.NamedTemporaryFile():
-            p = Process(target = killMyPort, args=(port,))
-            p.start()
-            p.join()
+          proc = subprocess.Popen(["killSalomeWithPort.py", port])
+          proc.communicate()
     except ImportError:
       # :TODO: should be declared obsolete
       from killSalome import killAllPorts
index bcdc822e67c0e2a51cd944696551d0bb356a0436..c8280afb9d2e254a935cf2b33ae8abbd07a1d07d 100755 (executable)
@@ -81,7 +81,7 @@ class TestCompo(unittest.TestCase):
 
   def create_JobParameters(self):
     job_params = salome.JobParameters()
-    job_params.wckey="P11U5:CARBONES" #needed by edf clusters
+    job_params.wckey="P11N0:SALOME" #needed by edf clusters
     job_params.resource_required = salome.ResourceParameters()
     job_params.resource_required.nb_proc = 1
     return job_params