def read_config(self, *args, **kwargs): try: serialized = self.core.config_manager.get(self.NAME) except (ConfigError, KeyError): self.config = SnmpdConf() else: self.config = SnmpdConf.deserialize(serialized) try: serialized = self.core.config_manager.get("contact") except (ConfigError, KeyError): self.contact_config = ContactConf.defaultConf() else: self.contact_config = ContactConf.deserialize(serialized)
def read_config(self, *args, **kwargs): self.config = ContactConf.defaultConf() try: serialized = self.core.config_manager.get(self.NAME) except ConfigError: self.debug("Not configured, defaults loaded.") return valid, message = self._setconfig(serialized) if not valid: self.error( "This means that the configuration is incorrect or that there is a bug" )