def _read_config(self): try: serialized = self.core.config_manager.get(self.MASTER_KEY) return IdsIpsCfg.deserialize(serialized) except (ConfigError, KeyError): self.warning("IDS-IPS not configured, default values loaded") return IdsIpsCfg()
def resetConf(self, no_interface=False): serialized = self.mainwindow.init_call("ids_ips", u'getIdsIpsConfig') self.config = IdsIpsCfg.deserialize(serialized) self._modified = False if no_interface: return self.updateView()
def service_setIdsIpsConfig(self, context, serialized, message): self.ids_ips_cfg = IdsIpsCfg.deserialize(serialized) ok, msg = self.ids_ips_cfg.isValidWithMsg() if not ok: raise IdsIpsError(IDS_IPS_INVALID_CONFIG, msg) self.save_config(message, context)