crm_debug("Returning existing action (%d) %s for %s on %s",
crm_devel("Returning existing action (%d) %s for %s on %s",
action_new(resource_t *rsc, enum action_tasks task, node_t *on_node){	action_t *action = NULL;	GListPtr possible_matches = NULL;	if(rsc != NULL) {		possible_matches =			find_actions(rsc->actions, task, on_node);	}	if(on_node != NULL && on_node->details->unclean) {		crm_warn("Not creating action  %s for %s because %s is unclean",			 task2text(task), rsc?rsc->id:"<NULL>",			 on_node->details->id);	}	if(on_node != NULL && on_node->details->unclean) {		crm_warn("Not creating action  %s for %s because %s is unclean",			 task2text(task), rsc?rsc->id:"<NULL>",			 on_node->details->id);	}		if(possible_matches != NULL) {		if(g_list_length(possible_matches) > 1) {			crm_err("Action %s for %s on %s exists %d times",				task2text(task), rsc?rsc->id:"<NULL>",				on_node?on_node->details->id:"<NULL>",				g_list_length(possible_matches));		}				action = g_list_nth_data(possible_matches, 0);		crm_debug("Returning existing action (%d) %s for %s on %s",			  action->id,			  task2text(task), rsc?rsc->id:"<NULL>",			  on_node?on_node->details->id:"<NULL>");		/* todo: free possible_matches */		return action;	}		crm_debug("Creating action %s for %s on %s",		  task2text(task), rsc?rsc->id:"<NULL>",		  on_node?on_node->details->id:"<NULL>");	crm_malloc(action, sizeof(action_t));	if(action != NULL) {		action->id   = action_id++;		action->rsc  = rsc;		action->task = task;		action->node = on_node;		action->actions_before   = NULL;		action->actions_after    = NULL;		action->failure_is_fatal = TRUE;		action->pseudo = FALSE;		action->dumped     = FALSE;		action->discard    = FALSE;		action->runnable   = TRUE;		action->processed  = FALSE;		action->optional   = FALSE;		action->seen_count = 0;		action->timeout    = NULL;		action->args       = create_xml_node(NULL, "args");				if(rsc != NULL) {			crm_debug("Adding created action to its resource");			rsc->actions = g_list_append(rsc->actions, action);			if(task == start_rsc) {				rsc->starting = TRUE;				action->timeout = rsc->start_timeout;			} else if(task == stop_rsc) {				rsc->stopping = TRUE;				action->timeout = rsc->stop_timeout;			} else {				action->timeout = rsc->def_timeout;			}					}	}	crm_debug("Action %d created", action->id);	return action;}