]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Portability Alpha_OSF :
authorrahuel <rahuel@opencascade.com>
Fri, 5 Nov 2004 08:57:57 +0000 (08:57 +0000)
committerrahuel <rahuel@opencascade.com>
Fri, 5 Nov 2004 08:57:57 +0000 (08:57 +0000)
HOST environment variable instead of HOSTNAME

src/Utils/Utils_Identity.py

index 42dac4f3a7ea14b7848f4e26b159492f62e3048b..9ac223486819ed0b341cad802644e17b90625492 100644 (file)
@@ -30,6 +30,7 @@
 
 import sys
 import os
+import string
 import socket
 import pwd
 import time
@@ -38,8 +39,11 @@ class Identity:
     def __init__(self,name):
         self._name = name
         self._pid =  os.getpid()
-        self._machine = os.getenv( "HOSTNAME" )
-        self._adip     =  socket.gethostbyname(self._machine) # IP adress
+        #self._machine = os.getenv( "HOSTNAME" )
+        HostName = os.getenv( "HOST" )
+        myMachine = string.split( HostName , '.' )
+        self._machine = myMachine[0]
+        self._adip     =  socket.gethostbyname( myMachine[0] ) # IP adress
         self._uid      = os.getuid() 
         list = pwd.getpwuid(self._uid)
         self._pwname   = list[0] # user name