diff options
Diffstat (limited to 'lib/lrmd/lrmd_output.c')
-rw-r--r-- | lib/lrmd/lrmd_output.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/lib/lrmd/lrmd_output.c b/lib/lrmd/lrmd_output.c index b0524c6..49900e5 100644 --- a/lib/lrmd/lrmd_output.c +++ b/lib/lrmd/lrmd_output.c @@ -1,5 +1,5 @@ /* - * Copyright 2020 the Pacemaker project contributors + * Copyright 2020-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -11,6 +11,7 @@ #include <stdarg.h> #include <crm/lrmd_internal.h> +#include <crm/common/xml.h> #include <crm/common/output_internal.h> static int @@ -46,10 +47,14 @@ lrmd__alternatives_list_xml(pcmk__output_t *out, va_list args) { lrmd_list_t *list = va_arg(args, lrmd_list_t *); const char *agent_spec = va_arg(args, const char *); - pcmk__output_xml_create_parent(out, "providers", - "for", agent_spec, + int rc = pcmk_rc_ok; + + pcmk__output_xml_create_parent(out, PCMK_XE_PROVIDERS, + PCMK_XA_FOR, agent_spec, NULL); - return xml_list(out, list, "provider"); + rc = xml_list(out, list, PCMK_XE_PROVIDER); + pcmk__output_xml_pop_parent(out); + return rc; } PCMK__OUTPUT_ARGS("alternatives-list", "lrmd_list_t *", "const char *") @@ -68,15 +73,20 @@ lrmd__agents_list_xml(pcmk__output_t *out, va_list args) { const char *agent_spec = va_arg(args, const char *); const char *provider = va_arg(args, const char *); - xmlNodePtr node = pcmk__output_xml_create_parent(out, "agents", - "standard", agent_spec, - NULL); + int rc = pcmk_rc_ok; + xmlNodePtr node = NULL; + + node = pcmk__output_xml_create_parent(out, PCMK_XE_AGENTS, + PCMK_XA_STANDARD, agent_spec, + NULL); if (!pcmk__str_empty(provider)) { - crm_xml_add(node, "provider", provider); + crm_xml_add(node, PCMK_XA_PROVIDER, provider); } - return xml_list(out, list, "agent"); + rc = xml_list(out, list, PCMK_XE_AGENT); + pcmk__output_xml_pop_parent(out); + return rc; } PCMK__OUTPUT_ARGS("agents-list", "lrmd_list_t *", "const char *", "const char *") @@ -100,15 +110,18 @@ lrmd__providers_list_xml(pcmk__output_t *out, va_list args) { lrmd_list_t *list = va_arg(args, lrmd_list_t *); const char *agent_spec = va_arg(args, const char *); - xmlNodePtr node = pcmk__output_xml_create_parent(out, "providers", - "standard", "ocf", + int rc = pcmk_rc_ok; + xmlNodePtr node = pcmk__output_xml_create_parent(out, PCMK_XE_PROVIDERS, + PCMK_XA_STANDARD, "ocf", NULL); if (agent_spec != NULL) { - crm_xml_add(node, "agent", agent_spec); + crm_xml_add(node, PCMK_XA_AGENT, agent_spec); } - return xml_list(out, list, "provider"); + rc = xml_list(out, list, PCMK_XE_PROVIDER); + pcmk__output_xml_pop_parent(out); + return rc; } PCMK__OUTPUT_ARGS("providers-list", "lrmd_list_t *", "const char *") |