2 CTDB legacy config handling
4 Copyright (C) Martin Schwenke 2018
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #include "lib/util/debug.h"
24 #include "common/conf.h"
25 #include "common/logging.h"
27 #include "legacy_conf.h"
29 #define LEGACY_SCRIPT_LOG_LEVEL_DEFAULT "ERROR"
31 static bool legacy_conf_validate_script_log_level(const char *key
,
32 const char *old_loglevel
,
33 const char *new_loglevel
,
34 enum conf_update_mode mode
)
39 ok
= debug_level_parse(new_loglevel
, &log_level
);
41 D_ERR("Invalid value for [%s] -> %s = %s\n",
51 void legacy_conf_init(struct conf_context
*conf
)
53 conf_define_section(conf
, LEGACY_CONF_SECTION
, NULL
);
55 conf_define_boolean(conf
,
57 LEGACY_CONF_REALTIME_SCHEDULING
,
60 conf_define_boolean(conf
,
62 LEGACY_CONF_RECMASTER_CAPABILITY
,
65 conf_define_boolean(conf
,
67 LEGACY_CONF_LMASTER_CAPABILITY
,
70 conf_define_boolean(conf
,
72 LEGACY_CONF_START_AS_STOPPED
,
75 conf_define_boolean(conf
,
77 LEGACY_CONF_START_AS_DISABLED
,
80 conf_define_string(conf
,
82 LEGACY_CONF_SCRIPT_LOG_LEVEL
,
83 LEGACY_SCRIPT_LOG_LEVEL_DEFAULT
,
84 legacy_conf_validate_script_log_level
);