| 178 | } |
| 179 | |
| 180 | static gboolean |
| 181 | check_action_definition(resource_t * rsc, node_t * active_node, xmlNode * xml_op, |
| 182 | pe_working_set_t * data_set) |
| 183 | { |
| 184 | char *key = NULL; |
| 185 | int interval = 0; |
| 186 | const char *interval_s = NULL; |
| 187 | |
| 188 | gboolean did_change = FALSE; |
| 189 | |
| 190 | xmlNode *params_all = NULL; |
| 191 | xmlNode *params_restart = NULL; |
| 192 | GHashTable *local_rsc_params = NULL; |
| 193 | |
| 194 | char *digest_all_calc = NULL; |
| 195 | const char *digest_all = NULL; |
| 196 | |
| 197 | const char *restart_list = NULL; |
| 198 | const char *digest_restart = NULL; |
| 199 | char *digest_restart_calc = NULL; |
| 200 | |
| 201 | action_t *action = NULL; |
| 202 | const char *task = crm_element_value(xml_op, XML_LRM_ATTR_TASK); |
| 203 | const char *op_version = crm_element_value(xml_op, XML_ATTR_CRM_VERSION); |
| 204 | |
| 205 | CRM_CHECK(active_node != NULL, return FALSE); |
| 206 | if (safe_str_eq(task, RSC_STOP)) { |
| 207 | return FALSE; |
| 208 | } |
| 209 | |
| 210 | interval_s = crm_element_value(xml_op, XML_LRM_ATTR_INTERVAL); |
| 211 | interval = crm_parse_int(interval_s, "0"); |
| 212 | /* we need to reconstruct the key because of the way we used to construct resource IDs */ |
| 213 | key = generate_op_key(rsc->id, task, interval); |
| 214 | |
| 215 | if (interval > 0) { |
| 216 | xmlNode *op_match = NULL; |
| 217 | |
| 218 | pe_rsc_trace(rsc, "Checking parameters for %s", key); |
| 219 | op_match = find_rsc_op_entry(rsc, key); |
| 220 | |
| 221 | if (op_match == NULL && is_set(data_set->flags, pe_flag_stop_action_orphans)) { |
| 222 | CancelXmlOp(rsc, xml_op, active_node, "orphan", data_set); |
| 223 | free(key); |
| 224 | return TRUE; |
| 225 | |
| 226 | } else if (op_match == NULL) { |
| 227 | pe_rsc_debug(rsc, "Orphan action detected: %s on %s", key, active_node->details->uname); |
| 228 | free(key); |
| 229 | return TRUE; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | action = custom_action(rsc, key, task, active_node, TRUE, FALSE, data_set); |
| 234 | /* key is free'd by custom_action() */ |
| 235 | |
| 236 | local_rsc_params = g_hash_table_new_full(crm_str_hash, g_str_equal, |
| 237 | g_hash_destroy_str, g_hash_destroy_str); |
no test coverage detected