| 471 | } |
| 472 | |
| 473 | gboolean |
| 474 | shutdown_constraints(node_t * node, action_t * shutdown_op, pe_working_set_t * data_set) |
| 475 | { |
| 476 | /* add the stop to the before lists so it counts as a pre-req |
| 477 | * for the shutdown |
| 478 | */ |
| 479 | GListPtr lpc = NULL; |
| 480 | |
| 481 | for (lpc = data_set->actions; lpc != NULL; lpc = lpc->next) { |
| 482 | action_t *action = (action_t *) lpc->data; |
| 483 | |
| 484 | if (action->rsc == NULL || action->node == NULL) { |
| 485 | continue; |
| 486 | } else if(action->node->details != node->details) { |
| 487 | continue; |
| 488 | } else if(is_set(data_set->flags, pe_flag_maintenance_mode)) { |
| 489 | pe_rsc_trace(action->rsc, "Skipping %s: maintainence mode", action->uuid); |
| 490 | continue; |
| 491 | } else if(safe_str_neq(action->task, RSC_STOP)) { |
| 492 | continue; |
| 493 | } else if(is_not_set(action->rsc->flags, pe_rsc_managed) |
| 494 | && is_not_set(action->rsc->flags, pe_rsc_block)) { |
| 495 | /* |
| 496 | * If another action depends on this one, we may still end up blocking |
| 497 | */ |
| 498 | pe_rsc_trace(action->rsc, "Skipping %s: unmanaged", action->uuid); |
| 499 | continue; |
| 500 | } |
| 501 | |
| 502 | pe_rsc_trace(action->rsc, "Ordering %s before shutdown on %s", action->uuid, node->details->uname); |
| 503 | clear_bit(action->flags, pe_action_optional); |
| 504 | custom_action_order(action->rsc, NULL, action, |
| 505 | NULL, strdup(CRM_OP_SHUTDOWN), shutdown_op, |
| 506 | pe_order_optional|pe_order_runnable_left, data_set); |
| 507 | } |
| 508 | |
| 509 | return TRUE; |
| 510 | } |
| 511 | |
| 512 | gboolean |
| 513 | stonith_constraints(node_t * node, action_t * stonith_op, pe_working_set_t * data_set) |
no test coverage detected