 } else if(chosen->details->unclean || chosen->details->shutdown) { crm_debug("Even highest ranked node for color %d" " is unclean or shutting down", color->id); return FALSE;  } else if(chosen->weight < 0) { crm_debug("Even highest ranked node for color %d, had weight %f", color->id, chosen->weight); return FALSE; 
choose_node_from_list(color_t *color){	/*	  1. Sort by weight	  2. color.chosen_node = the node (of those with the highest wieght)				   with the fewest resources	  3. remove color.chosen_node from all other colors	*/	GListPtr nodes = color->details->candidate_nodes;	node_t *chosen = NULL;	crm_devel("Choosing node for color %d", color->id);	nodes  = g_list_sort(nodes, sort_node_weight);	chosen = g_list_nth_data(nodes, 0);	color->details->chosen_node = NULL;	color->details->pending = FALSE;	if(chosen == NULL) {		crm_debug("Could not allocate a node for color %d", color->id);		return FALSE;	}	/* todo: update the old node for each resource to reflect its	 * new resource count	 */		chosen->details->num_resources += color->details->num_resources;	color->details->chosen_node = node_copy(chosen);	return TRUE;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/cbc207d25b34144969e9b75271b12d51296db667/stages.c/clean/crm/pengine/stages.c