]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Small fix for '#17662 [CEA] hostname and SALOME' issue.
authorrnv <rnv@opencascade.com>
Mon, 18 Nov 2019 12:24:42 +0000 (15:24 +0300)
committerrnv <rnv@opencascade.com>
Mon, 18 Nov 2019 12:24:42 +0000 (15:24 +0300)
bin/nameserver.py

index 25796989200446f3ef2699d27d00bbb484b7c732..ed5664ec4180e2f246cd10c581fe4f0cdc7d9acd 100644 (file)
@@ -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)]