From: ptv Date: Tue, 16 May 2006 07:27:34 +0000 (+0000) Subject: use specila function from Util_Identity to get name of host X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=babde34f3666e855c14f3cbc8ad65de9eb40275d;p=modules%2Fkernel.git use specila function from Util_Identity to get name of host --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index b26c6ca28..6ff6b3034 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -4,11 +4,13 @@ import os, sys, pickle, signal, commands def getPiDict(port,appname='salome',full=True): from Utils_Identity import getShortHostName - host = os.getenv("HOSTNAME") + # get hostname by special function in all cases to + # have always same result in lower case at win32 + host = getShortHostName() if not host: - host = os.getenv("HOST") + host = os.getenv("HOSTNAME") if not host: - host = getShortHostName() + host = os.getenv("HOST") filedict = [] filedict.append( os.getenv('USER') ) # user name diff --git a/bin/nameserver.py b/bin/nameserver.py index 155a323f4..1db35862d 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -3,6 +3,7 @@ import sys, os, re #import commands from server import * +from Utils_Identity import getShortHostName # ----------------------------------------------------------------------------- @@ -45,7 +46,8 @@ class NamingServer(Server): #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") print "Name Service... " - hname=os.environ["HOST"] #commands.getoutput("hostname") + #hname=os.environ["HOST"] #commands.getoutput("hostname") + hname=getShortHostName() print "hname=",hname f=open(os.environ["OMNIORB_CONFIG"]) diff --git a/bin/runNS.py b/bin/runNS.py index 06edc0226..1059aa1b1 100755 --- a/bin/runNS.py +++ b/bin/runNS.py @@ -3,6 +3,7 @@ #log files localization import os, commands, sys, re +from Utils_Identity import getShortHostName if sys.platform == "win32": # temporarily using home directory for Namning Service logs @@ -43,7 +44,9 @@ def startOmni(): #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") print "Name Service... " - hname=os.environ["HOST"] #commands.getoutput("hostname") + #hname=os.environ["HOST"] #commands.getoutput("hostname") + hname=getShortHostName() + print "hname=",hname f=open(os.environ["OMNIORB_CONFIG"]) diff --git a/bin/runSalome.py b/bin/runSalome.py index 434169c86..a93e92db5 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -428,10 +428,10 @@ def startSalome(args, modules_list, modules_root_dir): from Utils_Identity import getShortHostName if os.getenv("HOSTNAME") == None: - if os.getenv("HOST") == None: + #if os.getenv("HOST") == None: os.environ["HOSTNAME"]=getShortHostName() - else: - os.environ["HOSTNAME"]=os.getenv("HOST") + #else: + # os.environ["HOSTNAME"]=os.getenv("HOST") theComputer = getShortHostName() diff --git a/src/TestContainer/TestComponentPy.py b/src/TestContainer/TestComponentPy.py index 2dacf6dbb..e56cbda95 100755 --- a/src/TestContainer/TestComponentPy.py +++ b/src/TestContainer/TestComponentPy.py @@ -34,6 +34,7 @@ import string from omniORB import CORBA import CosNaming import Engines +from Utils_Identity import getShortHostName #initialise the ORB @@ -48,8 +49,7 @@ if rootContext is None: sys.exit(1) #resolve the name /Containers.dir/FactoryServerPy.object -myMachine=string.split(os.getenv( "HOSTNAME" ),'.') -machineName= myMachine[0] +machineName=getShortHostName() containerName = "FactoryServerPy" name = [CosNaming.NameComponent("Containers","dir"), CosNaming.NameComponent(machineName,"dir"),