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

Function is_op_dup

pengine/native.c:551–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551static gboolean
552is_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
591void
592RecurringOp(resource_t * rsc, action_t * start, node_t * node,

Callers 2

RecurringOpFunction · 0.85
RecurringOp_StoppedFunction · 0.85

Calls 5

__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
crm_element_valueFunction · 0.85
safe_str_neqFunction · 0.85

Tested by

no test coverage detected