From: rnv Date: Mon, 18 Nov 2019 12:24:42 +0000 (+0300) Subject: Small fix for '#17662 [CEA] hostname and SALOME' issue. X-Git-Tag: EMC2P_V_1_2_0~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fb0ae46e805b8c31b4801884424dcf8f6857f0d5;p=modules%2Fkernel.git Small fix for '#17662 [CEA] hostname and SALOME' issue. --- diff --git a/bin/nameserver.py b/bin/nameserver.py index 257969892..ed5664ec4 100644 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -90,7 +90,11 @@ class NamingServer(Server): # get ip address on default interface (for instance eth0) to limit listening on this interface (cyber security request) from subprocess import check_output ips = check_output(['hostname', '--all-ip-addresses']) - ipDefault = ips.split()[0].decode() + if ips.strip(): + ipDefault = ips.split()[0].decode() + else: + ip = check_output(['hostname', '--ip-address']) + ipDefault = ip.split()[-1].decode() self.CMD = ['omniNames','-start' , aPort] self.CMD += ['-logdir' , upath, '-errlog', upath+'/omniNameErrors.log'] self.CMD += ['-ORBendPoint', 'giop:tcp:%s:%s'%(hname,aPort)]