const char *strength = xmlGetProp(xml_obj, "strength");
strength = xmlGetProp(xml_obj, "strength");
unpack_constraints(xmlNodePtr constraints){	cl_log(LOG_DEBUG, "Begining unpack... %s", __FUNCTION__);	while(constraints != NULL) {		const char *id = xmlGetProp(constraints, "id");		xmlNodePtr xml_obj = constraints;		constraints = constraints->next;		if(id == NULL) {			cl_log(LOG_ERR, "Constraint must have an id");			continue;		}		cl_log(LOG_DEBUG, "Processing constraint %s", id);		rsc_constraint_t *new_con = cl_malloc(sizeof(rsc_constraint_t));		rsc_constraint_t *inverted_con = NULL;		const char *id_lh =  xmlGetProp(xml_obj, "from");		cl_log(LOG_DEBUG, "Looking up resource...");		resource_t *rsc_lh = pe_find_resource(rsc_list, id_lh);		if(rsc_lh == NULL) {			cl_log(LOG_ERR, "No resource (con=%s, rsc=%s)",			       id, id_lh);			continue;		}		new_con->id = cl_strdup(id);		new_con->rsc_lh = rsc_lh;		if(safe_str_eq("rsc_to_rsc", xml_obj->name)) {			new_con->type = rsc_to_rsc;			const char *strength = xmlGetProp(xml_obj, "strength");			if(safe_str_eq(strength, "must")) {				new_con->strength = must;			} else if(safe_str_eq(strength, "should")) {				new_con->strength = should;			} else if(safe_str_eq(strength, "should_not")) {				new_con->strength = should_not;			} else if(safe_str_eq(strength, "must_not")) {				new_con->strength = must_not;			} else {				// error			}			const char *type = xmlGetProp(xml_obj, "type");			if(safe_str_eq(type, "ordering")) {				new_con->is_placement = FALSE;			} else if (safe_str_eq(type, "placement")) {				new_con->is_placement = TRUE;			} else {				// error			}      			new_con->node_rh = NULL;			const char *id_rh = xmlGetProp(xml_obj, "to");			resource_t *rsc_rh = pe_find_resource(rsc_list, id_rh);			if(rsc_rh == NULL) {				cl_log(LOG_ERR, "No rh resource found with id %s", id_rh);				continue;			}			new_con->rsc_rh = rsc_rh;			inverted_con = invert_constraint(new_con);			cons_list = g_slist_insert_sorted(cons_list, inverted_con, sort_cons_strength);			cons_list = g_slist_insert_sorted(cons_list, new_con, sort_cons_strength);		} else if(safe_str_eq("rsc_to_node", xml_obj->name)) {			xmlNodePtr node_ref = xml_obj->children;			new_con->type = rsc_to_node;			new_con->rsc_rh = NULL;			const char *mod = xmlGetProp(xml_obj, "modifier");			const char *weight = xmlGetProp(xml_obj, "weight");			float weight_f = atof(weight);			new_con->weight = weight_f;			cl_log(LOG_DEBUG, "Mod: %s", mod);						if(safe_str_eq(mod, "set")){				new_con->modifier = set;			} else if(safe_str_eq(mod, "inc")){				new_con->modifier = inc;			} else if(safe_str_eq(mod, "dec")){				new_con->modifier = dec;			} else {				// error			}/*  <rsc_to_node>     <node_ref id= type= name=/>     <node_ref id= type= name=/>     <node_ref id= type= name=/>*/		//						while(node_ref != NULL) {				const char *id_rh = xmlGetProp(node_ref, "name");				rsc_constraint_t *cons_copy = copy_constraint(new_con);				cons_copy->node_rh = pe_find_node(rsc_lh->allowed_nodes, id_rh);								if(cons_copy->node_rh == NULL) {					// error					cl_log(LOG_ERR,					       "node %s (from %s) not found",					       id_rh, node_ref->name);				} else {					cons_list = g_slist_insert_sorted(cons_list, cons_copy, sort_cons_strength);				}													/* dont add it to the resource,				 *  the information is in the resouce's node list				 */				node_ref = node_ref->next;			}			cl_free(new_con->id);			cl_free(new_con);		} else {			// error		}	}	int lpc = 0;	cl_log(LOG_INFO, "========= Constraints =========");	slist_iter(resource, rsc_constraint_t, cons_list, lpc,		   print_cons(resource, FALSE));	return TRUE;}