Report notification successor from target action

This commit is contained in:
Lyncoln
2026-09-17 17:13:34 -04:00
parent 6f90b66700
commit 942457e48f
2 changed files with 25 additions and 2 deletions
+17 -2
View File
@@ -494,9 +494,23 @@ def notify_target(config, runtime_state, request_parameters):
operation = notification.get("operation")
if operation == "demote":
target_node = notification.get("demote_uname", "").strip().lower()
target_node = notification.get(
"demote_uname",
"",
).strip().lower()
successor_node = notification.get(
"promote_uname",
"",
).strip().lower()
elif operation == "promote":
target_node = notification.get("promote_uname", "").strip().lower()
target_node = notification.get(
"promote_uname",
"",
).strip().lower()
successor_node = notification.get(
"demote_uname",
"",
).strip().lower()
else:
return {
"ocf_rc": 1,
@@ -511,6 +525,7 @@ def notify_target(config, runtime_state, request_parameters):
"target": target_node == node_name,
"operation": operation,
"target_node": target_node,
"successor_node": successor_node,
"node": node_name,
"age_seconds": age,
}