pdebug(cl_log(LOG_DEBUG, "Processing node lrm state")); add_positive_preference(lrm_state);
pdebug("determining node state");
unpack_status(xmlNodePtr status){	pdebug(cl_log(LOG_DEBUG, "Begining unpack %s", __FUNCTION__));	while(status != NULL) {		const char *id = xmlGetProp(status, "id");		const char *state = xmlGetProp(status, "state");		const char *exp_state = xmlGetProp(status, "exp_state");		xmlNodePtr lrm_state = find_xml_node(status, "lrm");		xmlNodePtr attrs = find_xml_node(status, "attributes");		lrm_state = find_xml_node(lrm_state, "lrm_resources");		lrm_state = find_xml_node(lrm_state, "rsc_state");		status = status->next;		pdebug(cl_log(LOG_DEBUG, "Processing node %s", id));		if(id == NULL){			// error			continue;		}		pdebug(cl_log(LOG_DEBUG, "Processing node attrs"));				node_t *this_node = pe_find_node(node_list, id);		while(attrs != NULL){			const char *name = xmlGetProp(attrs, "name");			const char *value = xmlGetProp(attrs, "value");						if(name != NULL && value != NULL) {				pdebug(cl_log(LOG_DEBUG, "Adding %s => %s",					      name, value));				g_hash_table_insert(this_node->details->attrs,						    cl_strdup(name),						    cl_strdup(value));			}			attrs = attrs->next;		}		pdebug(cl_log(LOG_DEBUG, "Processing node lrm state"));		add_positive_preference(lrm_state);				if(safe_str_eq(exp_state, "active")		   && safe_str_eq(state, "active")) {			// process resource, make +ve preference			this_node->details->online = TRUE;					} else {			pdebug(cl_log(LOG_DEBUG, "remove %s", __FUNCTION__));			// remove node from contention			this_node->weight = -1;			this_node->fixed = TRUE;			pdebug(cl_log(LOG_DEBUG, "state %s, expected %s",				      state, exp_state));						if(safe_str_eq(state, "shutdown")){				// create shutdown req				shutdown_list = g_slist_append(shutdown_list,							       this_node);			} else if(safe_str_eq(exp_state, "active")				  && safe_str_neq(state, "active")) {				// mark unclean in the xml				state = "unclean";								// remove any running resources from being allocated			}      			if(safe_str_eq(state, "unclean")) {				stonith_list = g_slist_append(stonith_list,							      this_node);			}		}	}	cons_list = g_slist_sort(cons_list, sort_cons_strength);	return TRUE;	}