Salome HOME
Fix a bug that salome does not start if launched with --port option
[modules/yacs.git] / bin / searchFreePort.py
old mode 100644 (file)
new mode 100755 (executable)
index 999a952..27e51dc
@@ -132,6 +132,9 @@ def searchFreePort_withPortManager(queue, args={}, save_config=1, use_port=None)
     if port == use_port and port != -1:
       print "- OK"
       __setup_config(use_port, args, save_config)
+      queue.put([os.environ['OMNIORB_CONFIG'],
+                 os.environ['NSPORT'],
+                 os.environ['NSHOST']])
       return
     else:
       print "- KO: port is busy"
@@ -167,7 +170,6 @@ def searchFreePort(args={}, save_config=1, use_port=None):
   Search free port for SALOME session.
   Returns first found free port number.
   """
-
   try:
     import PortManager # mandatory
     from multiprocessing import Process, Queue
@@ -178,6 +180,7 @@ def searchFreePort(args={}, save_config=1, use_port=None):
 
     os.environ['OMNIORB_CONFIG'] = info[0]
     os.environ['NSPORT'] = info[1]
+    args['port'] = os.environ['NSPORT']
     os.environ['NSHOST'] = info[2]
     __savePortToFile(args)