Salome HOME
If concurrent execution mode OFF
authoraguerre <aguerre>
Mon, 13 Jan 2014 13:01:58 +0000 (13:01 +0000)
committeraguerre <aguerre>
Mon, 13 Jan 2014 13:01:58 +0000 (13:01 +0000)
bin/salomeRunner.py
bin/searchFreePort.py

index b9632206371588b423c42bb1b2bbb40b9bb0b8f1..aa1dee6cafbf41b3de61f3c98a7ac38dbec8eb35 100644 (file)
@@ -267,11 +267,11 @@ class SalomeRunner:
   def _killAll(self, args=[]):
     absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
     try:
-      import PortManager
-      ports = PortManager.getBusyPorts()
-
+      import PortManager # mandatory
       from multiprocessing import Process
       from killSalomeWithPort import killMyPort
+      ports = PortManager.getBusyPorts()
+
       if ports:
         import tempfile
         for port in ports:
@@ -279,13 +279,15 @@ class SalomeRunner:
             p = Process(target = killMyPort, args=(port,))
             p.start()
             p.join()
+
+      p = Process(target = killMyPort, args=(2809,))
+      p.start()
+      p.join()
     except ImportError:
+      from killSalome import killAllPorts
+      killAllPorts()
       pass
 
-    p = Process(target = killMyPort, args=(2809,))
-    p.start()
-    p.join()
-
   #
 
   def _showInfo(self, args=[]):
index 0bcc470b2e659cee5ef24e8c36e97e1b6514b4ce..712ec257b6488becede9e5b3475578ba2be3da28 100644 (file)
@@ -158,6 +158,7 @@ def searchFreePort(args={}, save_config=1, use_port=None):
   Returns first found free port number.
   """
   try:
+    import PortManager # mandatory
     from multiprocessing import Process, Queue
     queue = Queue()
     p = Process(target = searchFreePort_withPortManager, args=(queue, args, save_config, use_port,))