]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Issue '17716 [CEA] KERNEL: retrieve IP of Host' - implementation of the cross platfor...
authorrnv <rnv@opencascade.com>
Wed, 2 Oct 2019 15:50:25 +0000 (18:50 +0300)
committerrnv <rnv@opencascade.com>
Wed, 2 Oct 2019 15:50:25 +0000 (18:50 +0300)
bin/ORBConfigFile.py

index 27bcf996e2e642505a67c121804bdd24ce72e39c..ba512034a63dcb5c2801f0a9f125517d45af0772 100755 (executable)
@@ -66,14 +66,11 @@ def writeORBConfigFile(path, host, port, kwargs={}):
   orbdata.append("%smaxGIOPConnectionPerServer = 500 # to allow containers parallel launch"%(prefix))
   orbdata.append("%snativeCharCodeSet = UTF-8"%(prefix))
 
-  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,''))
+  import socket
+  # get ip address on default interface (for instance eth0) to limit listening on this interface (cyber security request)
+  ipDefault = socket.gethostbyname(socket.gethostname())
+  orbdata.append("%sendPoint = giop:tcp:127.0.0.1:%s"%(prefix,''))
+  orbdata.append("%sendPoint = giop:tcp:%s:%s"%(prefix, ipDefault,''))
 
   orbdata.append("")