From fb0ae46e805b8c31b4801884424dcf8f6857f0d5 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 18 Nov 2019 15:24:42 +0300 Subject: [PATCH] Small fix for '#17662 [CEA] hostname and SALOME' issue. --- bin/nameserver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)] -- 2.39.2