| 549 | } |
| 550 | |
| 551 | static gboolean |
| 552 | is_op_dup(resource_t * rsc, const char *name, const char *interval) |
| 553 | { |
| 554 | gboolean dup = FALSE; |
| 555 | const char *id = NULL; |
| 556 | const char *value = NULL; |
| 557 | xmlNode *operation = NULL; |
| 558 | |
| 559 | for (operation = __xml_first_child(rsc->ops_xml); operation != NULL; |
| 560 | operation = __xml_next(operation)) { |
| 561 | if (crm_str_eq((const char *)operation->name, "op", TRUE)) { |
| 562 | value = crm_element_value(operation, "name"); |
| 563 | if (safe_str_neq(value, name)) { |
| 564 | continue; |
| 565 | } |
| 566 | |
| 567 | value = crm_element_value(operation, XML_LRM_ATTR_INTERVAL); |
| 568 | if (value == NULL) { |
| 569 | value = "0"; |
| 570 | } |
| 571 | |
| 572 | if (safe_str_neq(value, interval)) { |
| 573 | continue; |
| 574 | } |
| 575 | |
| 576 | if (id == NULL) { |
| 577 | id = ID(operation); |
| 578 | |
| 579 | } else { |
| 580 | crm_config_err("Operation %s is a duplicate of %s", ID(operation), id); |
| 581 | crm_config_err |
| 582 | ("Do not use the same (name, interval) combination more than once per resource"); |
| 583 | dup = TRUE; |
| 584 | } |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | return dup; |
| 589 | } |
| 590 | |
| 591 | void |
| 592 | RecurringOp(resource_t * rsc, action_t * start, node_t * node, |
no test coverage detected