summaryrefslogtreecommitdiffstats
path: root/tools/cibadmin.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:46:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:46:09 +0000
commit043aa641ad4373e96fd748deb1e7fab3cb579a07 (patch)
treef8fde8a97ab5db152043f6c01043672114c0a4df /tools/cibadmin.c
parentReleasing progress-linux version 2.1.6-5~progress7.99u1. (diff)
downloadpacemaker-043aa641ad4373e96fd748deb1e7fab3cb579a07.tar.xz
pacemaker-043aa641ad4373e96fd748deb1e7fab3cb579a07.zip
Merging upstream version 2.1.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/cibadmin.c')
-rw-r--r--tools/cibadmin.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/cibadmin.c b/tools/cibadmin.c
index f80afae..44488b5 100644
--- a/tools/cibadmin.c
+++ b/tools/cibadmin.c
@@ -72,8 +72,6 @@ void cibadmin_op_callback(xmlNode *msg, int call_id, int rc, xmlNode *output,
static void
print_xml_output(xmlNode * xml)
{
- char *buffer;
-
if (!xml) {
return;
} else if (xml->type != XML_ELEMENT_NODE) {
@@ -95,8 +93,8 @@ print_xml_output(xmlNode * xml)
}
} else {
- buffer = dump_xml_formatted(xml);
- fprintf(stdout, "%s", pcmk__s(buffer, "<null>\n"));
+ char *buffer = dump_xml_formatted(xml);
+ fprintf(stdout, "%s", buffer);
free(buffer);
}
}
@@ -574,7 +572,7 @@ main(int argc, char **argv)
output = createEmptyCib(1);
crm_xml_add(output, XML_ATTR_VALIDATION, options.validate_with);
buf = dump_xml_formatted(output);
- fprintf(stdout, "%s", pcmk__s(buf, "<null>\n"));
+ fprintf(stdout, "%s", buf);
free(buf);
goto done;
}
@@ -726,7 +724,7 @@ main(int argc, char **argv)
goto done;
}
- if (strcmp(options.cib_action, "md5-sum") == 0) {
+ if (pcmk__str_eq(options.cib_action, "md5-sum", pcmk__str_casei)) {
char *digest = NULL;
if (input == NULL) {
@@ -885,7 +883,7 @@ do_work(xmlNode *input, xmlNode **output)
/* construct the request */
the_cib->call_timeout = options.message_timeout_sec;
if ((strcmp(options.cib_action, PCMK__CIB_REQUEST_REPLACE) == 0)
- && pcmk__str_eq(crm_element_name(input), XML_TAG_CIB, pcmk__str_casei)) {
+ && pcmk__xe_is(input, XML_TAG_CIB)) {
xmlNode *status = pcmk_find_cib_element(input, XML_CIB_TAG_STATUS);
if (status == NULL) {