| 1086 | } |
| 1087 | |
| 1088 | static enum action_tasks |
| 1089 | clone_child_action(action_t * action) |
| 1090 | { |
| 1091 | enum action_tasks result = no_action; |
| 1092 | resource_t *child = (resource_t *) action->rsc->children->data; |
| 1093 | |
| 1094 | if (safe_str_eq(action->task, "notify") |
| 1095 | || safe_str_eq(action->task, "notified")) { |
| 1096 | |
| 1097 | /* Find the action we're notifying about instead */ |
| 1098 | |
| 1099 | int stop = 0; |
| 1100 | char *key = action->uuid; |
| 1101 | int lpc = strlen(key); |
| 1102 | |
| 1103 | for (; lpc > 0; lpc--) { |
| 1104 | if (key[lpc] == '_' && stop == 0) { |
| 1105 | stop = lpc; |
| 1106 | |
| 1107 | } else if (key[lpc] == '_') { |
| 1108 | char *task_mutable = NULL; |
| 1109 | |
| 1110 | lpc++; |
| 1111 | task_mutable = strdup(key + lpc); |
| 1112 | task_mutable[stop - lpc] = 0; |
| 1113 | |
| 1114 | crm_trace("Extracted action '%s' from '%s'", task_mutable, key); |
| 1115 | result = get_complex_task(child, task_mutable, TRUE); |
| 1116 | free(task_mutable); |
| 1117 | break; |
| 1118 | } |
| 1119 | } |
| 1120 | |
| 1121 | } else { |
| 1122 | result = get_complex_task(child, action->task, TRUE); |
| 1123 | } |
| 1124 | return result; |
| 1125 | } |
| 1126 | |
| 1127 | enum pe_action_flags |
| 1128 | clone_action_flags(action_t * action, node_t * node) |
no test coverage detected