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

Function should_dump_action

pengine/graph.c:711–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711static gboolean
712should_dump_action(action_t * action)
713{
714 CRM_CHECK(action != NULL, return FALSE);
715
716 if (is_set(action->flags, pe_action_dumped)) {
717 crm_trace( "action %d (%s) was already dumped",
718 action->id, action->uuid);
719 return FALSE;
720
721 } else if (is_set(action->flags, pe_action_pseudo) && safe_str_eq(action->task, CRM_OP_PROBED)) {
722 GListPtr lpc = NULL;
723
724 /* This is a horrible but convenient hack
725 *
726 * It mimimizes the number of actions with unsatisfied inputs
727 * (ie. not included in the graph)
728 *
729 * This in turn, means we can be more concise when printing
730 * aborted/incomplete graphs.
731 *
732 * It also makes it obvious which node is preventing
733 * probe_complete from running (presumably because it is only
734 * partially up)
735 *
736 * For these reasons we tolerate such perversions
737 */
738
739 for (lpc = action->actions_after; lpc != NULL; lpc = lpc->next) {
740 action_wrapper_t *wrapper = (action_wrapper_t *) lpc->data;
741
742 if (is_not_set(wrapper->action->flags, pe_action_runnable)) {
743 /* Only interested in runnable operations */
744 } else if (safe_str_neq(wrapper->action->task, RSC_START)) {
745 /* Only interested in start operations */
746 } else if (is_set(wrapper->action->flags, pe_action_dumped)) {
747 crm_trace( "action %d (%s) dependancy of %s",
748 action->id, action->uuid, wrapper->action->uuid);
749 return TRUE;
750
751 } else if (should_dump_action(wrapper->action)) {
752 crm_trace( "action %d (%s) dependancy of %s",
753 action->id, action->uuid, wrapper->action->uuid);
754 return TRUE;
755 }
756 }
757 }
758
759 if (is_set(action->flags, pe_action_runnable) == FALSE) {
760 crm_trace( "action %d (%s) was not runnable",
761 action->id, action->uuid);
762 return FALSE;
763
764 } else if (is_set(action->flags, pe_action_optional)
765 && is_set(action->flags, pe_action_print_always) == FALSE) {
766 crm_trace( "action %d (%s) was optional", action->id, action->uuid);
767 return FALSE;
768

Callers 2

should_dump_inputFunction · 0.85

Calls 4

is_setFunction · 0.85
is_not_setFunction · 0.85
safe_str_neqFunction · 0.85
log_actionFunction · 0.85

Tested by

no test coverage detected