From 5fdf59f3bf2ec02503d2e743aa35a028e95d832b Mon Sep 17 00:00:00 2001 From: rahuel Date: Fri, 5 Nov 2004 08:57:57 +0000 Subject: [PATCH] Portability Alpha_OSF : HOST environment variable instead of HOSTNAME --- src/Utils/Utils_Identity.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.2