From: rahuel Date: Fri, 5 Nov 2004 08:57:57 +0000 (+0000) Subject: Portability Alpha_OSF : X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5fdf59f3bf2ec02503d2e743aa35a028e95d832b;p=modules%2Fkernel.git Portability Alpha_OSF : HOST environment variable instead of HOSTNAME --- diff --git a/src/Utils/Utils_Identity.py b/src/Utils/Utils_Identity.py index 42dac4f3a..9ac223486 100644 --- a/src/Utils/Utils_Identity.py +++ b/src/Utils/Utils_Identity.py @@ -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