| 359 | } |
| 360 | |
| 361 | int |
| 362 | cib_process_delete_absolute(const char *op, int options, const char *section, xmlNode * req, |
| 363 | xmlNode * input, xmlNode * existing_cib, xmlNode ** result_cib, |
| 364 | xmlNode ** answer) |
| 365 | { |
| 366 | xmlNode *failed = NULL; |
| 367 | int result = pcmk_ok; |
| 368 | xmlNode *update_section = NULL; |
| 369 | |
| 370 | crm_trace("Processing \"%s\" event for section=%s", op, crm_str(section)); |
| 371 | if (safe_str_eq(XML_CIB_TAG_SECTION_ALL, section)) { |
| 372 | section = NULL; |
| 373 | |
| 374 | } else if (safe_str_eq(XML_TAG_CIB, section)) { |
| 375 | section = NULL; |
| 376 | |
| 377 | } else if (safe_str_eq(crm_element_name(input), XML_TAG_CIB)) { |
| 378 | section = NULL; |
| 379 | } |
| 380 | |
| 381 | CRM_CHECK(strcasecmp(CIB_OP_DELETE, op) == 0, return -EINVAL); |
| 382 | |
| 383 | if (input == NULL) { |
| 384 | crm_err("Cannot perform modification with no data"); |
| 385 | return -EINVAL; |
| 386 | } |
| 387 | |
| 388 | failed = create_xml_node(NULL, XML_TAG_FAILED); |
| 389 | |
| 390 | update_section = get_object_root(section, *result_cib); |
| 391 | result = delete_cib_object(update_section, input); |
| 392 | update_results(failed, input, op, result); |
| 393 | |
| 394 | if (xml_has_children(failed)) { |
| 395 | CRM_CHECK(result != pcmk_ok, result = -EINVAL); |
| 396 | } |
| 397 | |
| 398 | if (result != pcmk_ok) { |
| 399 | crm_log_xml_err(failed, "CIB Update failures"); |
| 400 | *answer = failed; |
| 401 | |
| 402 | } else { |
| 403 | free_xml(failed); |
| 404 | } |
| 405 | |
| 406 | return result; |
| 407 | } |
| 408 | |
| 409 | gboolean |
| 410 | check_generation(xmlNode * newCib, xmlNode * oldCib) |
nothing calls this directly
no test coverage detected