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

Function text2role

lib/pengine/common.c:367–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367enum rsc_role_e
368text2role(const char *role)
369{
370 CRM_ASSERT(role != NULL);
371 if (safe_str_eq(role, RSC_ROLE_STOPPED_S)) {
372 return RSC_ROLE_STOPPED;
373 } else if (safe_str_eq(role, RSC_ROLE_STARTED_S)) {
374 return RSC_ROLE_STARTED;
375 } else if (safe_str_eq(role, RSC_ROLE_SLAVE_S)) {
376 return RSC_ROLE_SLAVE;
377 } else if (safe_str_eq(role, RSC_ROLE_MASTER_S)) {
378 return RSC_ROLE_MASTER;
379 } else if (safe_str_eq(role, RSC_ROLE_UNKNOWN_S)) {
380 return RSC_ROLE_UNKNOWN;
381 }
382 crm_err("Unknown role: %s", role);
383 return RSC_ROLE_UNKNOWN;
384}
385
386int
387merge_weights(int w1, int w2)

Callers 9

unpack_operationFunction · 0.85
get_target_roleFunction · 0.85
test_role_expressionFunction · 0.85
unpack_rsc_locationFunction · 0.85
generate_location_ruleFunction · 0.85
rsc_colocation_newFunction · 0.85
rsc_ticket_newFunction · 0.85
RecurringOpFunction · 0.85
RecurringOp_StoppedFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_role_expressionFunction · 0.68