Salome HOME
Merge branch 'rbe/evol-job-newparams'
[modules/kernel.git] / bin / searchFreePort.py
index 0d284b817fce21fe6dec43de49521c224d60cae5..9b14fabdb12a3a28e84a361f99a9f550abe2c6dc 100644 (file)
@@ -8,7 +8,7 @@
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -158,7 +158,6 @@ def __savePortToFile(args):
   if args.has_key('ns_port_log_file'):
     omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
     file_name = os.path.join(omniorbUserPath, args["ns_port_log_file"])
-    print file_name, os.environ['NSPORT']
     with open(file_name, "w") as f:
       f.write(os.environ['NSPORT'])
 #
@@ -168,7 +167,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
@@ -179,6 +177,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)