MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / cibadmin_op_callback

Function cibadmin_op_callback

tools/cibadmin.c:587–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587void
588cibadmin_op_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void *user_data)
589{
590 exit_code = rc;
591
592 if (safe_str_eq(cib_action, CIB_OP_ISMASTER) && rc != pcmk_ok) {
593 crm_info("CIB on %s is _not_ the master instance", host ? host : "localhost");
594 fprintf(stderr, "CIB on %s is _not_ the master instance\n", host ? host : "localhost");
595
596 } else if (safe_str_eq(cib_action, CIB_OP_ISMASTER)) {
597 crm_info("CIB on %s _is_ the master instance", host ? host : "localhost");
598 fprintf(stderr, "CIB on %s _is_ the master instance\n", host ? host : "localhost");
599
600 } else if (rc != 0) {
601 crm_warn("Call %s failed (%d): %s", cib_action, rc, pcmk_strerror(rc));
602 fprintf(stderr, "Call %s failed (%d): %s\n", cib_action, rc, pcmk_strerror(rc));
603 print_xml_output(output);
604
605 } else if (safe_str_eq(cib_action, CIB_OP_QUERY) && output == NULL) {
606 crm_err("Output expected in query response");
607 crm_log_xml_err(msg, "no output");
608
609 } else if (output == NULL) {
610 crm_info("Call passed");
611
612 } else {
613 crm_info("Call passed");
614 print_xml_output(output);
615 }
616
617 if (call_id == request_id) {
618 g_main_quit(mainloop);
619
620 } else {
621 crm_info("Message was not the response we were looking for (%d vs. %d", call_id,
622 request_id);
623 }
624}

Callers

nothing calls this directly

Calls 2

pcmk_strerrorFunction · 0.85
print_xml_outputFunction · 0.85

Tested by

no test coverage detected