]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Simplify getPiDict() method (taking host name)
authorvsr <vsr@opencascade.com>
Thu, 17 Nov 2005 15:46:17 +0000 (15:46 +0000)
committervsr <vsr@opencascade.com>
Thu, 17 Nov 2005 15:46:17 +0000 (15:46 +0000)
bin/killSalomeWithPort.py

index 404c9ef8f56f517c0b83f7e888c8fdfc8bb4970f..e52a25f883fec97a6273a12c1389926f73042fc2 100755 (executable)
@@ -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