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

Function RecurringOp

pengine/native.c:591–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591void
592RecurringOp(resource_t * rsc, action_t * start, node_t * node,
593 xmlNode * operation, pe_working_set_t * data_set)
594{
595 char *key = NULL;
596 const char *name = NULL;
597 const char *value = NULL;
598 const char *interval = NULL;
599 const char *node_uname = NULL;
600
601 unsigned long long interval_ms = 0;
602 action_t *mon = NULL;
603 gboolean is_optional = TRUE;
604 GListPtr possible_matches = NULL;
605
606 /* Only process for the operations without role="Stopped" */
607 value = crm_element_value(operation, "role");
608 if (value && text2role(value) == RSC_ROLE_STOPPED) {
609 return;
610 }
611
612 pe_rsc_trace(rsc, "Creating recurring action %s for %s in role %s on %s",
613 ID(operation), rsc->id, role2text(rsc->next_role),
614 node ? node->details->uname : "n/a");
615
616 if (node != NULL) {
617 node_uname = node->details->uname;
618 }
619
620 interval = crm_element_value(operation, XML_LRM_ATTR_INTERVAL);
621 interval_ms = crm_get_interval(interval);
622
623 if (interval_ms == 0) {
624 return;
625 }
626
627 name = crm_element_value(operation, "name");
628 if (is_op_dup(rsc, name, interval)) {
629 return;
630 }
631
632 if (safe_str_eq(name, RSC_STOP)
633 || safe_str_eq(name, RSC_START)
634 || safe_str_eq(name, RSC_DEMOTE)
635 || safe_str_eq(name, RSC_PROMOTE)
636 ) {
637 crm_config_err("Invalid recurring action %s wth name: '%s'", ID(operation), name);
638 return;
639 }
640
641 key = generate_op_key(rsc->id, name, interval_ms);
642 if (find_rsc_op_entry(rsc, key) == NULL) {
643 /* disabled */
644 free(key);
645 return;
646 }
647
648 if (start != NULL) {

Callers 1

RecurringFunction · 0.85

Calls 14

crm_element_valueFunction · 0.85
text2roleFunction · 0.85
role2textFunction · 0.85
crm_get_intervalFunction · 0.85
is_op_dupFunction · 0.85
generate_op_keyFunction · 0.85
find_rsc_op_entryFunction · 0.85
is_setFunction · 0.85
find_actions_exactFunction · 0.85
custom_actionFunction · 0.85
add_hash_paramFunction · 0.85
custom_action_orderFunction · 0.85

Tested by

no test coverage detected