From 57d5ed8594d12edcdd01145ddb8ff06bdbc1cee8 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 17 Nov 2005 15:46:17 +0000 Subject: [PATCH] Simplify getPiDict() method (taking host name) --- bin/killSalomeWithPort.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 -- 2.39.2