X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2Fnameserver.py;h=19fde8e96bf6f3062ba9aff671e2474bba680509;hb=c08881e6e17a2480fb307ee4c92d784386bdb97d;hp=5f806971eaf5fabd0889ecc7a4916b2c8ff63f5e;hpb=9550eea6bd87260ed34793d35ce860345e644e5c;p=modules%2Fkernel.git diff --git a/bin/nameserver.py b/bin/nameserver.py index 5f806971e..19fde8e96 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # @@ -25,7 +25,7 @@ import os, sys, re, socket #import commands from server import Server -from Utils_Identity import getShortHostName +from salome_utils import getHostName from launchConfigureParser import verbose # ----------------------------------------------------------------------------- @@ -46,13 +46,8 @@ class NamingServer(Server): except: pass - if verbose(): print("Name Service... ", end=' ') - #hname=os.environ["HOST"] #commands.getoutput("hostname") - if sys.platform == "win32": - hname = getShortHostName(); - else: - hname = socket.gethostname(); - #print "hname=",hname + if verbose(): print("Name Service... ", end =' ') + hname = getHostName() with open(os.environ["OMNIORB_CONFIG"]) as f: ss = re.findall("NameService=corbaname::" + hname + ":\d+", f.read()) @@ -73,7 +68,7 @@ class NamingServer(Server): try: os.mkdir(upath) except: - #print "Can't create " + upath + # print("Can't create " + upath) pass #os.system("touch " + upath + "/dummy") @@ -85,11 +80,11 @@ class NamingServer(Server): #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") #aSedCommand="s/.*NameService=corbaname::" + hname + ":\([[:digit:]]*\)/\1/" - #print "sed command = ", aSedCommand + # print("sed command = ", aSedCommand) #aPort = commands.getoutput("sed -e\"" + aSedCommand + "\"" + os.environ["OMNIORB_CONFIG"]) - #print "port=", aPort + # print("port=", aPort) if sys.platform == "win32": - #print "start omniNames -start " + aPort + " -logdir " + upath + # print("start omniNames -start " + aPort + " -logdir " + upath) self.CMD = ['omniNames', '-start' , aPort , '-nohostname', '-logdir' , os.path.realpath(upath), '-errlog', os.path.realpath(os.path.join(upath,'omniNameErrors.log'))] #os.system("start omniNames -start " + aPort + " -logdir " + upath) else: