From: rnv Date: Wed, 2 Oct 2019 15:50:25 +0000 (+0300) Subject: Issue '17716 [CEA] KERNEL: retrieve IP of Host' - implementation of the cross platfor... X-Git-Tag: V9_4_0a2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2241214273f0b121285f7b549984df52591c8716;p=modules%2Fkernel.git Issue '17716 [CEA] KERNEL: retrieve IP of Host' - implementation of the cross platform solution --- diff --git a/bin/ORBConfigFile.py b/bin/ORBConfigFile.py index 27bcf996e..ba512034a 100755 --- a/bin/ORBConfigFile.py +++ b/bin/ORBConfigFile.py @@ -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("")