def __init__(self, monitoring_enabled): """Create a LinuxMonitored instance""" # Get the monitoring rules from piglit.conf and store them into a dict. self._monitoring_rules = {} if monitoring_enabled and PIGLIT_CONFIG.has_section('monitored-errors'): for key, _ in PIGLIT_CONFIG.items('monitored-errors'): if PIGLIT_CONFIG.has_section(key): type = PIGLIT_CONFIG.required_get(key, 'type') regex = PIGLIT_CONFIG.required_get(key, 'regex') parameters = PIGLIT_CONFIG.required_get(key, 'parameters') self.add_rule(key, type, parameters, regex)