HomeClusterLabs Projects

Low: libpacemaker: Fix pacemakerd-health XML output

Description

Low: libpacemaker: Fix pacemakerd-health XML output

We were using F_CRM_SYS_FROM as the name of the XML element, instead of
something static like "pacemakerd". It happens that the value in
F_CRM_SYS_FROM seems to always be CRM_SYSTEM_MCP ("pacemakerd"), so the
element name was effectively deterministic. Nonetheless, the schema
required the element be called "pacemakerd"; there was no allowance for
another system name. That defeats any purpose of flexible element
naming.

It seems better to call the element "pacemakerd" and make
sys_from a field, if we keep sys_from at all. (Can't use
"pacemakerd-health" for backward compatibility reasons.)

Additionally, if sys_from or last_updated is NULL, pass them directly to
pcmk__output_create_xml_node(). Those attributes will simply be skipped
if their values are NULL.

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

Details

Provenance
nrwahl2Authored on Oct 11 2022, 1:03 AM
Parents
rPa640da07976e: Low: schemas: Add pacemakerd-health schema in preparation for fix
Branches
Unknown
Tags
Unknown