From f7f8b98e07378f3faf861bd23a50fd00ca5dcac5 Mon Sep 17 00:00:00 2001 From: Aleksei Burlakov Date: Fri, 19 Jul 2024 13:33:55 +0200 Subject: [PATCH] Fix: cibtools: adjust to the new cibadmin format Pacemaker 2.1.7 has a new format for the in_ccm and crmd fields. pacemaker < 2.1.7 - in_ccm ::= true|false - crmd ::= online|offline pacemaker >= 2.1.7 - in_ccm ::= |0 (0 if offline) - crmd ::= |0 --- hawk/app/lib/cibtools.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hawk/app/lib/cibtools.rb b/hawk/app/lib/cibtools.rb index 0ac07a35b..70a08fce7 100644 --- a/hawk/app/lib/cibtools.rb +++ b/hawk/app/lib/cibtools.rb @@ -35,7 +35,7 @@ def determine_online_status_fencing(ns) expected_up = get_xml_attr(ns, 'shutdown', '0') == 0 state = :unclean - if in_ccm && crm_state == 'online' + if in_ccm && (crm_state == 'online' || Util.numeric?(crm_state) && crm_state.to_i > 0) case join_state when 'member' # rock 'n' roll (online) state = :online @@ -52,6 +52,8 @@ def determine_online_status_fencing(ns) state = :offline # not online, but cleanly elsif expected_up state = :unclean # expected to be up, mark it unclean + elsif in_ccm && Util.numeric?(crm_state) && crm_state.to_i == 0 + state = :offline # offline (explicitely) else state = :offline # offline end @@ -73,7 +75,7 @@ def determine_online_status_no_fencing(ns) state = :unclean if !in_ccm state = :offline - elsif crm_state == 'online' + elsif crm_state == 'online' || Util.numeric?(crm_state) && crm_state.to_i > 0 if join_state == 'member' state = :online else