def METHOD_NAME(self):      
    PSU_STATE_REMOVE = 0
    PSU_STATE_INSERT = 1
    PSU_STATUS_NO_POWER = 0
    PSU_STATUS_POWER_GOOD = 1
    PSU_STATUS_IDLE =2
    global psu_state
    for idx in range (0, self.psu_num):           
        node = self.psu_path + self.mapping[idx] + self.presence
        try:
            val_file = open(node)
        except IOError as e:
            print("Error: unable to open file: %s" % str(e))          
            return False
        content = val_file.readline().rstrip()
        val_file.close()
        # content is a string, either "0" or "1"
        if content == "1":
            if psu_state[idx]!=1:
                psu_state[idx]=PSU_STATE_INSERT
                logging.info("PSU-%d present is detected", idx+1);
                #psu_status_state[idx]=PSU_STATUS_POWER_GOOD #when insert, assume power is good. If no_power, next code will find it.
        else:
            if psu_state[idx]!=0:
                psu_state[idx]=PSU_STATE_REMOVE
                logging.warning("Alarm for PSU-%d absent is detected", idx+1);
                psu_status_state[idx]=PSU_STATUS_IDLE
    for idx in range (0, self.psu_num):           
        node = self.psu_path + self.mapping[idx] + self.oper_status
        try:
            val_file = open(node)
        except IOError as e:
            print("Error: unable to open file: %s" % str(e))          
            return False
        content = val_file.readline().rstrip()
        val_file.close()
        # content is a string, either "0" or "1"
        if content == "0":
            if psu_status_state[idx]!=PSU_STATUS_NO_POWER:
                if psu_state[idx]==PSU_STATE_INSERT:
                    logging.warning("Alarm for PSU-%d failed is detected", idx+1);
                    psu_status_state[idx]=PSU_STATUS_NO_POWER
        else:
            if psu_state[idx]==PSU_STATE_INSERT:
                if psu_status_state[idx]!=PSU_STATUS_POWER_GOOD:
                    logging.info("PSU-%d power_good is detected", idx+1);
                    psu_status_state[idx]=PSU_STATUS_POWER_GOOD
    return True