]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
bos #17716 [CEA] KERNEL: retrieve IP of Host. A workaround for Windows by nghodban.
authorjfa <jfa@opencascade.com>
Thu, 19 Sep 2019 06:51:00 +0000 (09:51 +0300)
committerjfa <jfa@opencascade.com>
Thu, 19 Sep 2019 06:51:00 +0000 (09:51 +0300)
bin/ORBConfigFile.py

index ba06cebe174719c4fc0cb0464b6acad2b6828a28..27bcf996e2e642505a67c121804bdd24ce72e39c 100755 (executable)
@@ -56,11 +56,6 @@ def writeORBConfigFile(path, host, port, kwargs={}):
 
   from omniORB import CORBA
   prefix = "" if CORBA.ORB_ID == "omniORB4" else "ORB"
-  
-  from subprocess import check_output
-  ips = check_output(['hostname', '--all-ip-addresses'])
-  # get ip address on default interface (for instance eth0) to limit listening on this interface (cyber security request)
-  ipDefault = ips.split()[0].decode()
 
   GIOP_MaxMsgSize = 2097152000  # 2 GBytes
 
@@ -70,8 +65,16 @@ def writeORBConfigFile(path, host, port, kwargs={}):
   orbdata.append("%straceLevel = 0 # critical errors only"%(prefix))
   orbdata.append("%smaxGIOPConnectionPerServer = 500 # to allow containers parallel launch"%(prefix))
   orbdata.append("%snativeCharCodeSet = UTF-8"%(prefix))
-  orbdata.append("%sendPoint = giop:tcp:127.0.0.1:%s"%(prefix,''))
-  orbdata.append("%sendPoint = giop:tcp:%s:%s"%(prefix, ipDefault,''))
+
+  import sys
+  if "linux" in sys.platform:
+    from subprocess import check_output
+    ips = check_output(['hostname', '--all-ip-addresses'])
+    # get ip address on default interface (for instance eth0) to limit listening on this interface (cyber security request)
+    ipDefault = ips.split()[0].decode()
+    orbdata.append("%sendPoint = giop:tcp:127.0.0.1:%s"%(prefix,''))
+    orbdata.append("%sendPoint = giop:tcp:%s:%s"%(prefix, ipDefault,''))
+
   orbdata.append("")
 
   with open(omniorb_config, "w") as f: