if(safe_str_eq(task, CRMD_RSCSTATE_START) || safe_str_eq(task, CRMD_RSCSTATE_STOP) ) {
if(task_status_i == LRM_OP_NOTSUPPORTED || safe_str_eq(task, CRMD_RSCSTATE_STOP) || safe_str_eq(task, CRMD_RSCSTATE_START) ) {
unpack_rsc_op(resource_t *rsc, const char *last_op, const char *rsc_state,	      node_t *node, crm_data_t *xml_op,	      GListPtr *placement_constraints) {	const char *task        = NULL;/* 	const char *task_rc     = NULL; */	const char *task_status = NULL;	int task_status_i = -2;	CRM_DEV_ASSERT(rsc    != NULL); if(crm_assert_failed) { return FALSE; }	CRM_DEV_ASSERT(node   != NULL); if(crm_assert_failed) { return FALSE; }	CRM_DEV_ASSERT(xml_op != NULL); if(crm_assert_failed) { return FALSE; }		task        = crm_element_value(xml_op, XML_LRM_ATTR_TASK);/* 	task_rc     = crm_element_value(xml_op, XML_LRM_ATTR_RC); */	task_status = crm_element_value(xml_op, XML_LRM_ATTR_OPSTATUS);	CRM_DEV_ASSERT(task != NULL); if(crm_assert_failed) { return FALSE; }	CRM_DEV_ASSERT(task_status != NULL); if(crm_assert_failed) { return FALSE; }	task_status_i = crm_atoi(task_status, "-1");	if(node->details->unclean) {		crm_debug("Node %s (where %s is running) is unclean."			  " Further action depends on the value of %s",			  node->details->uname, rsc->id, XML_RSC_ATTR_STOPFAIL);	}	switch(task_status_i) {		case LRM_OP_PENDING:			/*			 * TODO: this may need some more thought			 * Some cases:			 * - PE reinvoked with pending action that will succeed			 * - PE reinvoked with pending action that will fail			 * - After DC election			 * - After startup			 *			 * pending start - required start			 * pending stop  - required stop			 * pending <any> on unavailable node - stonith			 *			 * For now this should do			 */			if(safe_str_eq(task, CRMD_RSCSTATE_STOP)) {				/* re-issue the stop and return */				action_new(rsc, stop_rsc, NULL, node);				native_add_running(rsc, node);				rsc->recover = TRUE;							} else if(safe_str_eq(task, CRMD_RSCSTATE_START)) {				rsc->start_pending = TRUE;				native_add_running(rsc, node);						/* make sure it is re-issued but,				 * only if we have quorum				 */				if(have_quorum == TRUE				   || no_quorum_policy == no_quorum_ignore){					/* do not specify the node, we may want					 * to start it elsewhere					 */					action_new(rsc, start_rsc, NULL, NULL);				}							} else if(safe_str_neq(last_op, CRMD_RSCSTATE_STOP)) {				crm_devel("Re-issuing pending recurring task:"					  " %s for %s on %s",					  task, rsc->id, node->details->id);				rsc->schedule_recurring = TRUE;				native_add_running(rsc, node);			}			break;				case LRM_OP_DONE:			if(safe_str_neq(task, last_op)) {				return TRUE;			}			crm_verbose("%s/%s completed on %s",				    rsc->id, task, node->details->uname);			if(safe_str_neq(task, CRMD_RSCSTATE_STOP)) {				crm_verbose("%s active on %s",					    rsc->id, node->details->uname);				native_add_running(rsc, node);			}			break;		case LRM_OP_ERROR:		case LRM_OP_TIMEOUT:		case LRM_OP_NOTSUPPORTED:			if(safe_str_eq(task, CRMD_RSCSTATE_START)			   || safe_str_eq(task, CRMD_RSCSTATE_STOP) ) {				crm_warn("Handling failed %s for %s on %s",					 task, rsc->id, node->details->uname);				rsc2node_new("dont_run__failed_stopstart",					     rsc, -INFINITY, FALSE, node,					     placement_constraints);			}			if(safe_str_neq(task, last_op)) {				return TRUE;			}						crm_debug("Processing last op (%s) for %s on %s",				  task, rsc->id, node->details->uname);			rsc->recover = TRUE;						if(safe_str_neq(task, CRMD_RSCSTATE_STOP)) {				action_t *stop = action_new(					rsc, stop_rsc, NULL, node);				stop->optional = FALSE;				native_add_running(rsc, node);			} else if(rsc->stopfail_type == pesf_stonith) {				/* treat it as if it is still running				 * but also mark the node as unclean				 */				rsc->unclean = TRUE;				node->details->unclean = TRUE;				native_add_running(rsc, node);			} else if(rsc->stopfail_type == pesf_block) {				/* let this depend on the stop action				 * which will fail but make sure the				 * transition continues...				 */				native_add_running(rsc, node);				rsc->unclean = TRUE;			/* } else { pretend the stop completed */			}			break;		case LRM_OP_CANCELLED:			/* do nothing?? */			crm_err("Dont know what to do for cancelled ops yet");			break;	}	return TRUE;}