Logo Search packages:      
Sourcecode: audit version File versions  Download package

def global_dialog::GlobalDialog::_save_config (   self,
  config 
) [private]

Modify config to reflect dialog state.

Definition at line 232 of file global_dialog.py.

00232                                   :
        '''Modify config to reflect dialog state.'''
        def exe_value(action, entry):
            '''Return the value for *_exe, depending on action and an text entry
            widget.'''
            if action != AC.FAILURE_EXEC:
                return None
            else:
                return entry.get_text()
        auditd = config.auditd
        auditd.action_mail_acct = self.action_mail_acct.get_text()
        auditd.admin_space_left = self.admin_space_left.get_value_as_int()
        auditd.admin_space_left_action = self._radio_get(self.
                                                         __admin_space_left_map)
        auditd.admin_space_left_exe = exe_value(auditd.admin_space_left_action,
                                                self.admin_space_left_exe)
        auditd.disk_error_action = self._radio_get(self.__disk_error_map)
        auditd.disk_error_exe = exe_value(auditd.disk_error_action,
                                          self.disk_error_exe)
        auditd.disk_full_action = self._radio_get(self.__disk_full_map)
        auditd.disk_full_exe = exe_value(auditd.disk_full_action,
                                         self.disk_full_exe)
        auditd.disp_qos = self._radio_get(self.__disp_qos_map)
        if self.dispatcher_enabled.get_active():
            auditd.dispatcher = self.dispatcher.get_text()
        else:
            auditd.dispatcher = None
        if self.flush_none.get_active():
            auditd.flush = AC.FLUSH_NONE
        elif self.freq.get_value_as_int() != 1:
            auditd.flush = AC.FLUSH_INCREMENTAL
        elif self.flush_not_sync.get_active():
            auditd.flush = AC.FLUSH_DATA
        else:
            auditd.flush = AC.FLUSH_SYNC
        if auditd.flush == AC.FLUSH_INCREMENTAL:
            auditd.freq = self.freq.get_value_as_int()
        else:
            auditd.freq = 0
        auditd.log_file = self.log_file.get_text()
        if self.log_format_raw.get_active():
            auditd.log_format = AC.FORMAT_RAW
        else:
            auditd.log_format = AC.FORMAT_NOLOG
        auditd.max_log_file = self.max_log_file.get_value_as_int()
        auditd.max_log_file_action = self._radio_get(self.__max_log_file_map)
        if type(auditd.max_log_file_action) == tuple:
            if self.max_log_file_rotate.get_active():
                auditd.max_log_file_action = AC.SIZE_ROTATE
            else:
                auditd.max_log_file_action = AC.SIZE_KEEP_LOGS
        auditd.num_logs = self.num_logs.get_value_as_int()
        auditd.priority_boost = self.priority_boost.get_value_as_int()
        auditd.space_left = self.space_left.get_value_as_int()
        auditd.space_left_action = self._radio_get(self.__space_left_map)
        auditd.space_left_exe = exe_value(auditd.space_left_action,
                                          self.space_left_exe)

        rules = config.rules
        rules.backlog_limit = self.backlog_max.get_value_as_int()
        rules.failure_handling = self._radio_get(self.__kernel_fail_map)
        if self.rate_limit_enabled.get_active():
            rules.rate_limit = self.rate_limit.get_value_as_int()
        else:
            rules.rate_limit = AR.RATE_LIMIT_DISABLED

    def _validate_get_failure(self):


Generated by  Doxygen 1.6.0   Back to index