def getPIDForString(self, s): pid = None try: processList = assistant.getProcessList() for p in processList: if p[1].find(s) != -1: pid = p[0] break del processList except Exception, e: PLOG.error("%s getPIDForString except:%s" % (self.name, e))
def getCommandForPID(self, pid): cmd = None try: processList = assistant.getProcessList() for p in processList: if p[0] == pid: cmd = p[1] break del processList except Exception, e: PLOG.error("%s getCommandForPID except:%s" % (self.name, e))