HomeClusterLabs Projects

Refactor: libcrmcommon: pcmk__xml_show() returns standard Pacemaker RC

Description

Refactor: libcrmcommon: pcmk__xml_show() returns standard Pacemaker RC

We use the RC selector function created in a previous commit.

  • pcmk_rc_no_output if nothing is output or if all calls to out->info() return pcmk_rc_no_output (for example, quiet mode is enabled or fmt_name == "none")
  • pcmk_rc_ok otherwise (expected)
  • some other return code in case of an unforeseen error

We also move show_xml_node()'s NULL check to pcmk__xml_show(), so that
we don't allocate a GString in that case. The only other caller,
show_xml_element(), should be unable to pass a NULL data argument.

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

Details

Provenance
nrwahl2Authored on Feb 8 2023, 9:05 PM
Parents
rPde2a3bea858b: Refactor: libcrmcommon: New pcmk__output_select_rc() function
Branches
Unknown
Tags
Unknown