| 1181 | } |
| 1182 | |
| 1183 | static enum pe_graph_flags |
| 1184 | clone_update_actions_interleave(action_t * first, action_t * then, node_t * node, |
| 1185 | enum pe_action_flags flags, enum pe_action_flags filter, |
| 1186 | enum pe_ordering type) |
| 1187 | { |
| 1188 | gboolean current = FALSE; |
| 1189 | resource_t *first_child = NULL; |
| 1190 | GListPtr gIter = then->rsc->children; |
| 1191 | enum pe_graph_flags changed = pe_graph_none; /*pe_graph_disable */ |
| 1192 | |
| 1193 | enum action_tasks task = clone_child_action(first); |
| 1194 | const char *first_task = task2text(task); |
| 1195 | |
| 1196 | /* Fix this - lazy */ |
| 1197 | if (strstr(first->uuid, "_stopped_0") || strstr(first->uuid, "_demoted_0")) { |
| 1198 | current = TRUE; |
| 1199 | } |
| 1200 | |
| 1201 | for (; gIter != NULL; gIter = gIter->next) { |
| 1202 | resource_t *then_child = (resource_t *) gIter->data; |
| 1203 | |
| 1204 | CRM_ASSERT(then_child != NULL); |
| 1205 | first_child = find_compatible_child(then_child, first->rsc, RSC_ROLE_UNKNOWN, current); |
| 1206 | if (first_child == NULL && current) { |
| 1207 | crm_trace("Ignore"); |
| 1208 | |
| 1209 | } else if (first_child == NULL) { |
| 1210 | crm_debug("No match found for %s (%d / %s / %s)", then_child->id, current, first->uuid, |
| 1211 | then->uuid); |
| 1212 | |
| 1213 | /* Me no like this hack - but what else can we do? |
| 1214 | * |
| 1215 | * If there is no-one active or about to be active |
| 1216 | * on the same node as then_child, then they must |
| 1217 | * not be allowed to start |
| 1218 | */ |
| 1219 | if (type & (pe_order_runnable_left | pe_order_implies_then) /* Mandatory */ ) { |
| 1220 | pe_rsc_info(then->rsc, "Inhibiting %s from being active", then_child->id); |
| 1221 | assign_node(then_child, NULL, TRUE); |
| 1222 | } |
| 1223 | |
| 1224 | } else { |
| 1225 | action_t *first_action = NULL; |
| 1226 | action_t *then_action = NULL; |
| 1227 | |
| 1228 | pe_rsc_debug(then->rsc, "Pairing %s with %s", first_child->id, then_child->id); |
| 1229 | |
| 1230 | first_action = find_first_action(first_child->actions, NULL, first_task, node); |
| 1231 | then_action = find_first_action(then_child->actions, NULL, then->task, node); |
| 1232 | |
| 1233 | CRM_CHECK(first_action != NULL || is_set(first_child->flags, pe_rsc_orphan), |
| 1234 | crm_err("No action found for %s in %s (first)", first_task, first_child->id)); |
| 1235 | |
| 1236 | if (then_action == NULL && is_not_set(then_child->flags, pe_rsc_orphan) |
| 1237 | && crm_str_eq(then->task, RSC_STOP, TRUE) == FALSE |
| 1238 | && crm_str_eq(then->task, RSC_DEMOTED, TRUE) == FALSE) { |
| 1239 | crm_err("Internal error: No action found for %s in %s (then)", then->task, |
| 1240 | then_child->id); |
no test coverage detected