Exemplo n.º 1
0
 def read_config(self, *args, **kwargs):
     try:
         serialized = self.core.config_manager.get(self.MASTER_KEY)
     except (ConfigError, KeyError):
         self.warning(tr('Syslog export not configured, default values loaded.'))
         self.syslog_export_cfg = SyslogExportConf()
     else:
         self.syslog_export_cfg = SyslogExportConf.deserialize(serialized)
Exemplo n.º 2
0
 def service_setSyslogExportConfig(self, context, serialized, message):
     self.syslog_export_cfg = SyslogExportConf.deserialize(serialized)
     valid, error_message = self.syslog_export_cfg.isValidWithMsg()
     if not valid:
         raise NuConfError(SYSLOG_EXPORT_BAD_CONFIGURATION,
                           tr("Error in syslog export configuration.") +
                           " " + error_message)
     self.save_config(message, context)