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

Function char2score

lib/common/utils.c:145–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145int
146char2score(const char *score)
147{
148 int score_f = 0;
149
150 if (score == NULL) {
151
152 } else if (safe_str_eq(score, MINUS_INFINITY_S)) {
153 score_f = -node_score_infinity;
154
155 } else if (safe_str_eq(score, INFINITY_S)) {
156 score_f = node_score_infinity;
157
158 } else if (safe_str_eq(score, "+" INFINITY_S)) {
159 score_f = node_score_infinity;
160
161 } else if (safe_str_eq(score, "red")) {
162 score_f = node_score_red;
163
164 } else if (safe_str_eq(score, "yellow")) {
165 score_f = node_score_yellow;
166
167 } else if (safe_str_eq(score, "green")) {
168 score_f = node_score_green;
169
170 } else {
171 score_f = crm_parse_int(score, NULL);
172 if (score_f > 0 && score_f > node_score_infinity) {
173 score_f = node_score_infinity;
174
175 } else if (score_f < 0 && score_f < -node_score_infinity) {
176 score_f = -node_score_infinity;
177 }
178 }
179
180 return score_f;
181}
182
183char *
184score2char(int score)

Callers 15

print_rsc_summaryFunction · 0.85
attrd_local_callbackFunction · 0.85
expand_plus_plusFunction · 0.85
get_failcount_by_prefixFunction · 0.85
get_failcountFunction · 0.85
unpack_configFunction · 0.85
unpack_nodesFunction · 0.85
unpack_domainsFunction · 0.85
common_unpackFunction · 0.85
calculate_system_healthFunction · 0.85
master_scoreFunction · 0.85

Calls 1

crm_parse_intFunction · 0.85

Tested by

no test coverage detected