From 282b0b91242e448214ce87a5a39c4786a2275857 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 4 Oct 2024 12:52:48 +0530 Subject: [PATCH] ctdb: Leave CTDB log levels at their original defaults There is too much information with the 'log level' explicitily set to DEBUG for ctdbd flooding the log file destination. Similarly 'script log level' option might also spit out more when set to DEBUG. Instead of removing the options altogether we change the sambacc defaults from DEBUG to NOTCE and ERROR respectively for 'log level' and 'script log level' options as specified in man ctdb.conf(5). ref: https://ctdb.samba.org/manpages/ctdb.conf.5.html Signed-off-by: Anoop C S --- sambacc/config.py | 4 ++-- tests/test_ctdb.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sambacc/config.py b/sambacc/config.py index bbb38f90..0ec0a487 100644 --- a/sambacc/config.py +++ b/sambacc/config.py @@ -312,8 +312,8 @@ def ctdb_config(self) -> dict[str, str]: ctdb.setdefault("cluster_meta_uri", CLUSTER_META_JSON) ctdb.setdefault("nodes_path", CTDB_NODES_PATH) ctdb.setdefault("recovery_lock", CTDB_RECLOCK) - ctdb.setdefault("log_level", "DEBUG") - ctdb.setdefault("script_log_level", "DEBUG") + ctdb.setdefault("log_level", "NOTICE") + ctdb.setdefault("script_log_level", "ERROR") ctdb.setdefault("realtime_scheduling", "false") # this whole thing really needs to be turned into a real object type ctdb.setdefault("public_addresses", []) diff --git a/tests/test_ctdb.py b/tests/test_ctdb.py index a151e29e..61247c93 100644 --- a/tests/test_ctdb.py +++ b/tests/test_ctdb.py @@ -438,7 +438,8 @@ def test_ensure_ctdb_conf(tmpdir): ctdb.ensure_ctdb_conf(iconfig=cfg.get("ctdb1"), path=path) with open(path, "r") as fh: data = fh.read() - assert "DEBUG" in data + assert "NOTICE" in data + assert "ERROR" in data assert "/var/lib/ctdb/shared/RECOVERY" in data