ClusterLabs / hawk

A web-based GUI for managing and monitoring the Pacemaker High-Availability cluster resource manager
http://hawk-ui.github.io/
GNU General Public License v2.0
151 stars 52 forks source link

Check rsc stonith is in maintenance by either of 2 keywords #275

Closed alvarocarvajald closed 8 months ago

alvarocarvajald commented 8 months ago

Newer versions of crmsh will report that a stonith resource is in maitenance by the maintenance keyword, while older versions use unmanaged instead.

This was addressed in commit b3998aaf6b23053772ad09eaa2e33964229c6fdb, but it is also causing the test script to connect twice to the cluster nodes over SSH to check first for unmanaged and then for maintenance.

Changes provided in this commit extend the function check_cluster_conf_ssh so it is able to match any or all of the keywords passed to it.

It does so by introducing a third parameter to check_cluster_conf_ssh so the function is able to match all provided keywords, or just one of them. The extra parameter informs the function whether it should do an "or" (set to false, i.e., "and", by default) and return True when any of the keywords is matched, or do an "and" and match all as it was doing before.

This commit also improves the log messages to reference both unmanaged and maintenance.

alvarocarvajald commented 8 months ago

@aleksei-burlakov @ricardobranco777 CYPR?

emiura commented 8 months ago

LGTM

aleksei-burlakov commented 8 months ago

It's even looking much better now. Thank you!