| 1036 | } |
| 1037 | |
| 1038 | GListPtr |
| 1039 | find_actions(GListPtr input, const char *key, node_t * on_node) |
| 1040 | { |
| 1041 | GListPtr gIter = input; |
| 1042 | GListPtr result = NULL; |
| 1043 | |
| 1044 | CRM_CHECK(key != NULL, return NULL); |
| 1045 | |
| 1046 | for (; gIter != NULL; gIter = gIter->next) { |
| 1047 | action_t *action = (action_t *) gIter->data; |
| 1048 | |
| 1049 | crm_trace("Matching %s against %s", key, action->uuid); |
| 1050 | if (safe_str_neq(key, action->uuid)) { |
| 1051 | continue; |
| 1052 | |
| 1053 | } else if (on_node == NULL) { |
| 1054 | result = g_list_prepend(result, action); |
| 1055 | |
| 1056 | } else if (action->node == NULL) { |
| 1057 | /* skip */ |
| 1058 | crm_trace("While looking for %s action on %s, " |
| 1059 | "found an unallocated one. Assigning" |
| 1060 | " it to the requested node...", key, on_node->details->uname); |
| 1061 | |
| 1062 | action->node = node_copy(on_node); |
| 1063 | result = g_list_prepend(result, action); |
| 1064 | |
| 1065 | } else if (on_node->details == action->node->details) { |
| 1066 | result = g_list_prepend(result, action); |
| 1067 | } |
| 1068 | } |
| 1069 | |
| 1070 | return result; |
| 1071 | } |
| 1072 | |
| 1073 | GListPtr |
| 1074 | find_actions_exact(GListPtr input, const char *key, node_t * on_node) |
no test coverage detected