HomeClusterLabs Projects

Feature: libpacemaker: pacemakerd-health message accepts state

Description

Feature: libpacemaker: pacemakerd-health message accepts state

Previously, the pacemakerd-health message accepted only a state string.
This made it difficult to use different state strings for different
output formats.

Now, the pacemakerd-health message accepts an enum pcmk_pacemakerd_state
value and an optional state string. If the state string is not set, then
the formatter function looks up an appropriate string representation for
the state. If the state string is set, it acts as an explicit override
and is used in place of a lookup.

Note that this will cause "invalid" to be printed instead of "<null>"
for quiet text outputs, and it will cause "Invalid pacemakerd state" to
be printed instead of "unknown state" for the default output.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Oct 10 2022, 6:12 PM
Parents
rP62affe35486e: Refactor: libpacemaker: Improve return codes in pcmk__pacemakerd_status
Branches
Unknown
Tags
Unknown