if(optional == FALSE) { crm_debug_2("Action %d marked manditory", action->id); action->optional = FALSE; }
custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node,	      pe_working_set_t *data_set){	action_t *action = NULL;	GListPtr possible_matches = NULL;	CRM_DEV_ASSERT(key != NULL);	if(crm_assert_failed) { return NULL; }		CRM_DEV_ASSERT(task != NULL);	if(crm_assert_failed) { return NULL; }	if(rsc != NULL) {		possible_matches = find_actions(rsc->actions, key, on_node);	}		if(possible_matches != NULL) {		crm_free(key);				if(g_list_length(possible_matches) > 1) {			pe_warn("Action %s for %s on %s exists %d times",				task, rsc?rsc->id:"<NULL>",				on_node?on_node->details->uname:"<NULL>",				g_list_length(possible_matches));		}				action = g_list_nth_data(possible_matches, 0);		crm_debug_4("Found existing action (%d) %s for %s on %s",			  action->id, task, rsc?rsc->id:"<NULL>",			  on_node?on_node->details->uname:"<NULL>");	}	if(action == NULL) {		crm_debug_4("Creating action %s for %s on %s",			  task, rsc?rsc->id:"<NULL>",			  on_node?on_node->details->uname:"<NULL>");		crm_malloc0(action, sizeof(action_t));		if(action != NULL) {			action->id   = data_set->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->runnable   = TRUE;			action->processed  = FALSE;			action->optional   = FALSE;			action->seen_count = 0;						action->extra = g_hash_table_new_full(				g_str_hash, g_str_equal,				g_hash_destroy_str, g_hash_destroy_str);			data_set->actions = g_list_append(					data_set->actions, action);			action->uuid = key;			if(rsc != NULL) {				action->op_entry = find_rsc_op_entry(rsc, key);				unpack_operation(					action, action->op_entry, data_set);				rsc->actions = g_list_append(					rsc->actions, action);			}			crm_debug_4("Action %d created", action->id);		}	}			if(rsc != NULL) {		if(action->node == NULL) {			action->runnable = FALSE;		} else if(action->node->details->online == FALSE) {			pe_warn("Action %d %s for %s on %s is unrunnable",				 action->id,				 task, rsc?rsc->id:"<NULL>",				 action->node?action->node->details->uname:"<none>");			action->runnable = FALSE;		} else 	if(action->needs == rsc_req_nothing) {			action->runnable = TRUE;					} else if(data_set->have_quorum == FALSE			&& data_set->no_quorum_policy == no_quorum_stop) {			action->runnable = FALSE;				} else {			action->runnable = TRUE;		}		switch(text2task(action->task)) {			case stop_rsc:				rsc->stopping = TRUE;				break;			case start_rsc:				rsc->starting = FALSE;				if(action->runnable) {					rsc->starting = TRUE;				}				break;			default:				break;		}	}	return action;}