MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / get_node_score

Function get_node_score

pengine/constraints.c:441–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441static int
442get_node_score(const char *rule, const char *score, gboolean raw, node_t * node)
443{
444 int score_f = 0;
445
446 if (score == NULL) {
447 pe_err("Rule %s: no score specified. Assuming 0.", rule);
448
449 } else if (raw) {
450 score_f = char2score(score);
451
452 } else {
453 const char *attr_score = g_hash_table_lookup(node->details->attrs, score);
454
455 if (attr_score == NULL) {
456 crm_debug("Rule %s: node %s did not have a value for %s",
457 rule, node->details->uname, score);
458 score_f = -INFINITY;
459
460 } else {
461 crm_debug("Rule %s: node %s had value %s for %s",
462 rule, node->details->uname, attr_score, score);
463 score_f = char2score(attr_score);
464 }
465 }
466 return score_f;
467}
468
469rsc_to_node_t *
470generate_location_rule(resource_t * rsc, xmlNode * rule_xml, pe_working_set_t * data_set)

Callers 1

generate_location_ruleFunction · 0.85

Calls 1

char2scoreFunction · 0.85

Tested by

no test coverage detected