Skip to content

Commit 600e3bf

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
sambacc: add monitor_cluster_meta_updates func to ctdb
In previous changes we split some of the ctdb functions to accept a ClusterMeta protocol object rather than a path to a file. Do the same for `manage_nodes` creating a `monitor_cluster_meta_updates` function. Signed-off-by: John Mulligan <[email protected]>
1 parent c6acc23 commit 600e3bf

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sambacc/ctdb.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,23 @@ def manage_nodes(
338338
pause_func: typing.Callable,
339339
) -> None:
340340
"""Monitor nodes json for updates, reflecting those changes into ctdb."""
341+
monitor_cluster_meta_updates(
342+
ClusterMetaJSONFile(nodes_json),
343+
pnn,
344+
real_path,
345+
pause_func,
346+
)
347+
348+
349+
def monitor_cluster_meta_updates(
350+
cmeta: ClusterMeta,
351+
pnn: int,
352+
real_path: str,
353+
pause_func: typing.Callable,
354+
) -> None:
355+
"""Monitor cluster meta for updates, reflecting those changes into ctdb."""
341356
while True:
342357
_logger.info("checking if node is able to make updates")
343-
cmeta = ClusterMetaJSONFile(nodes_json)
344358
if _node_check(cmeta, pnn, real_path):
345359
_logger.info("checking for node updates")
346360
if _node_update(cmeta, real_path):

0 commit comments

Comments
 (0)