if(safe_str_eq(value, INFINITY_S)) { data_set->default_resource_stickiness = INFINITY; } else if(safe_str_eq(value, MINUS_INFINITY_S)) { data_set->default_resource_stickiness = -INFINITY; } else { data_set->default_resource_stickiness = crm_atoi(value, "0"); }
data_set->default_resource_stickiness = char2score(value);
unpack_config(crm_data_t * config, pe_working_set_t *data_set){/* 	const char *attr_filter[] = { *//* 		"default_resource_stickiness", *//* 		"transition_idle_timeout", *//* 		"stonith_enabled", *//* 		"symmetric_cluster" *//* 	}; */		const char *value = NULL;	GHashTable *config_hash = g_hash_table_new_full(		g_str_hash,g_str_equal, g_hash_destroy_str,g_hash_destroy_str);	unpack_instance_attributes(		config, "cluster_property_set", NULL, config_hash,		NULL, 0, data_set);#if CRM_DEPRECATED_SINCE_2_0_1	param_value(config_hash, config, "transition_idle_timeout");	param_value(config_hash, config, "default_resource_stickiness");	param_value(config_hash, config, "stonith_enabled");	param_value(config_hash, config, "symmetric_cluster");	param_value(config_hash, config, "no_quorum_policy");#endif	value = g_hash_table_lookup(config_hash, "transition_idle_timeout");	if(value != NULL) {		long tmp = crm_get_msec(value);		if(tmp > 0) {			crm_free(data_set->transition_idle_timeout);			data_set->transition_idle_timeout = crm_strdup(value);		} else {			crm_err("Invalid value for %s: %s",				"transition_idle_timeout",				data_set->transition_idle_timeout);		}	}		crm_debug_4("%s set to: %s",		 "transition_idle_timeout", data_set->transition_idle_timeout);	value = g_hash_table_lookup(config_hash, "default_resource_stickiness");	if(safe_str_eq(value, INFINITY_S)) {		data_set->default_resource_stickiness = INFINITY;	} else if(safe_str_eq(value, MINUS_INFINITY_S)) {		data_set->default_resource_stickiness = -INFINITY;	} else {		data_set->default_resource_stickiness = crm_atoi(value, "0");	}				value = g_hash_table_lookup(config_hash, "stonith_enabled");	if(value != NULL) {		cl_str_to_boolean(value, &data_set->stonith_enabled);	}	crm_info("STONITH of failed nodes is %s",		 data_set->stonith_enabled?"enabled":"disabled");		value = g_hash_table_lookup(config_hash, "symmetric_cluster");	if(value != NULL) {		cl_str_to_boolean(value, &data_set->symmetric_cluster);	}	if(data_set->symmetric_cluster) {		crm_info("Cluster is symmetric"			 " - resources can run anywhere by default");	}	value = g_hash_table_lookup(config_hash, "no_quorum_policy");	if(safe_str_eq(value, "ignore")) {		data_set->no_quorum_policy = no_quorum_ignore;			} else if(safe_str_eq(value, "freeze")) {		data_set->no_quorum_policy = no_quorum_freeze;	} else {		data_set->no_quorum_policy = no_quorum_stop;	}		switch (data_set->no_quorum_policy) {		case no_quorum_freeze:			crm_info("On loss of CCM Quorum: Freeze resources");			break;		case no_quorum_stop:			crm_info("On loss of CCM Quorum: Stop ALL resources");			break;		case no_quorum_ignore:			crm_warn("On loss of CCM Quorum: Ignore");			break;	}	g_hash_table_destroy(config_hash);	return TRUE;}