def __init__(self, original): self.process = NullProcess() #make an attempt to update the original caller if hasattr(original, 'pid'): try: original.pid = self.process.pid except: pass if hasattr(original, 'inode'): try: original.inode = self.process.inode except: pass
def __init__(self, original): self.process = NullProcess() #assume the process is dead if original.server.hostname == config.HOSTNAME: #delay scanning the process, for as long as possible try: self.process = ProcessSnapshot(original.pid) except InvalidProcess: pass #raise all others else: self.process = RemoteProcess(original.pid) #make an attempt to update the original caller if hasattr(original, 'pid'): try: original.pid = self.process.pid except: pass if hasattr(original, 'inode'): try: original.inode = self.process.inode except: pass