process_trigger(action->id); return TRUE; #endif
initiate_action(action_t *action) {	gboolean ret = FALSE;	gboolean send_command = FALSE;	const char *on_node   = NULL;	const char *id        = NULL;	const char *task      = NULL;	const char *timeout   = NULL;	const char *msg_task    = XML_GRAPH_TAG_RSC_OP;	on_node  = crm_element_value(action->xml, XML_LRM_ATTR_TARGET);	id       = crm_element_value(action->xml, XML_ATTR_ID);	task     = crm_element_value(action->xml, XML_LRM_ATTR_TASK);	timeout  = crm_element_value(action->xml, XML_ATTR_TIMEOUT);	if(id == NULL || strlen(id) == 0	   || task == NULL || strlen(task) == 0) {		/* error */		te_log_action(LOG_ERR, "Failed on corrupted command: %s (id=%s) %s",			crm_element_name(action->xml),			crm_str(id), crm_str(task));	} else if(action->type == action_type_pseudo){		te_log_action(LOG_INFO, "Executing pseudo-event (%d): "			 "%s on %s", action->id, task, on_node);				action->complete = TRUE;		process_trigger(action->id);		ret = TRUE;	} else if(action->type == action_type_crm		  && safe_str_eq(task, CRM_OP_FENCE)){				crm_data_t *action_args = find_xml_node(			action->xml, XML_TAG_ATTRS, TRUE);		const char *uuid = NULL;		const char *target = NULL;		const char *name = NULL;#ifndef TESTING		stonith_ops_t * st_op = NULL;#endif		xml_child_iter(			action_args, nvpair, XML_CIB_TAG_NVPAIR,			name = crm_element_value(nvpair, XML_NVPAIR_ATTR_NAME);			if(safe_str_eq(name, XML_LRM_ATTR_TARGET)) {				target = crm_element_value(					nvpair, XML_NVPAIR_ATTR_VALUE);			} else if(safe_str_eq(name, XML_LRM_ATTR_TARGET_UUID)) {				uuid = crm_element_value(					nvpair, XML_NVPAIR_ATTR_VALUE);			} 			);		CRM_DEV_ASSERT(target != NULL);		CRM_DEV_ASSERT(uuid != NULL);		te_log_action(LOG_INFO, "Executing fencing operation (%s) on %s", id, target);#ifdef TESTING		ret = TRUE;		action->complete = TRUE;#else		crm_malloc0(st_op, sizeof(stonith_ops_t));		st_op->optype = RESET;		st_op->timeout = crm_atoi(timeout, "100"); /* ten seconds */		st_op->node_name = crm_strdup(target);		st_op->node_uuid = crm_strdup(uuid);		if(stonithd_input_IPC_channel() == NULL) {			crm_err("Cannot fence %s - stonith not available",				target);					} else if (ST_OK == stonithd_node_fence( st_op )) {			ret = TRUE;		}#endif			} else if(on_node == NULL || strlen(on_node) == 0) {