From: vsr Date: Thu, 17 Nov 2005 15:46:17 +0000 (+0000) Subject: Simplify getPiDict() method (taking host name) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=57d5ed8594d12edcdd01145ddb8ff06bdbc1cee8;p=modules%2Fkernel.git Simplify getPiDict() method (taking host name) --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 404c9ef8f..e52a25f88 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -3,16 +3,16 @@ import os, sys, pickle, signal, commands def getPiDict(port,appname='salome',full=True): from Utils_Identity import getShortHostName - - if os.getenv("HOSTNAME") == None: - if os.getenv("HOST") == None: - os.environ["HOSTNAME"]=getShortHostName() - else: - os.environ["HOSTNAME"]=os.getenv("HOST") + + host = os.getenv("HOSTNAME") + if not host: + host = os.getenv("HOST") + if not host: + host = getShortHostName() filedict = [] filedict.append( os.getenv('USER') ) # user name - filedict.append( os.getenv('HOSTNAME') ) # host name + filedict.append( host ) # host name filedict.append( str(port) ) # port number filedict.append( appname.upper() ) # application name filedict.append( 'pidict' ) # constant part