Skip to content

Commit 6862cc8

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
sambacc: move important CTDB constants to global vars
Put the most critical CTDB defaults in global string variables in the config module. These become defaults for the ctdb configuration subsection when ctdb is enabled for sambacc. Signed-off-by: John Mulligan <[email protected]>
1 parent eb50693 commit 6862cc8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sambacc/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343

4444
# the standard location for samba's smb.conf
4545
SMB_CONF = "/etc/samba/smb.conf"
46+
CLUSTER_META_JSON = "/var/lib/ctdb/shared/ctdb-nodes.json"
47+
CTDB_NODES_PATH = "/var/lib/ctdb/shared/nodes"
48+
CTDB_RECLOCK = "/var/lib/ctdb/shared/RECOVERY"
4649

4750
CTDB: typing.Final[str] = "ctdb"
4851
ADDC: typing.Final[str] = "addc"
@@ -306,9 +309,9 @@ def ctdb_config(self) -> dict[str, str]:
306309
if not self.with_ctdb:
307310
return {}
308311
ctdb = dict(self.gconfig.data.get("ctdb", {}))
309-
ctdb.setdefault("nodes_json", "/var/lib/ctdb/shared/ctdb-nodes.json")
310-
ctdb.setdefault("nodes_path", "/var/lib/ctdb/shared/nodes")
311-
ctdb.setdefault("recovery_lock", "/var/lib/ctdb/shared/RECOVERY")
312+
ctdb.setdefault("nodes_json", CLUSTER_META_JSON)
313+
ctdb.setdefault("nodes_path", CTDB_NODES_PATH)
314+
ctdb.setdefault("recovery_lock", CTDB_RECLOCK)
312315
ctdb.setdefault("log_level", "DEBUG")
313316
ctdb.setdefault("script_log_level", "DEBUG")
314317
ctdb.setdefault("realtime_scheduling", "false")

0 commit comments

Comments
 (0)