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

Function unpack_constraints

pengine/constraints.c:55–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53enum pe_ordering get_asymmetrical_flags(enum pe_order_kind kind);
54
55gboolean
56unpack_constraints(xmlNode * xml_constraints, pe_working_set_t * data_set)
57{
58 xmlNode *xml_obj = NULL;
59 xmlNode *lifetime = NULL;
60
61 for (xml_obj = __xml_first_child(xml_constraints); xml_obj != NULL;
62 xml_obj = __xml_next(xml_obj)) {
63 const char *id = crm_element_value(xml_obj, XML_ATTR_ID);
64
65 if (id == NULL) {
66 crm_config_err("Constraint <%s...> must have an id", crm_element_name(xml_obj));
67 continue;
68 }
69
70 crm_trace("Processing constraint %s %s", crm_element_name(xml_obj), id);
71
72 lifetime = first_named_child(xml_obj, "lifetime");
73 if (lifetime) {
74 crm_config_warn("Support for the lifetime tag, used by %s, is deprecated."
75 " The rules it contains should instead be direct decendants of the constraint object",
76 id);
77 }
78
79 if (test_ruleset(lifetime, NULL, data_set->now) == FALSE) {
80 crm_info("Constraint %s %s is not active", crm_element_name(xml_obj), id);
81
82 } else if (safe_str_eq(XML_CONS_TAG_RSC_ORDER, crm_element_name(xml_obj))) {
83 unpack_rsc_order(xml_obj, data_set);
84
85 } else if (safe_str_eq(XML_CONS_TAG_RSC_DEPEND, crm_element_name(xml_obj))) {
86 unpack_rsc_colocation(xml_obj, data_set);
87
88 } else if (safe_str_eq(XML_CONS_TAG_RSC_LOCATION, crm_element_name(xml_obj))) {
89 unpack_rsc_location(xml_obj, data_set);
90
91 } else if (safe_str_eq(XML_CONS_TAG_RSC_TICKET, crm_element_name(xml_obj))) {
92 unpack_rsc_ticket(xml_obj, data_set);
93
94 } else {
95 pe_err("Unsupported constraint type: %s", crm_element_name(xml_obj));
96 }
97 }
98
99 return TRUE;
100}
101
102static const char *
103invert_action(const char *action)

Callers 4

mainFunction · 0.85
mainFunction · 0.85
print_cluster_ticketsFunction · 0.85
stage0Function · 0.85

Calls 9

__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_element_valueFunction · 0.85
first_named_childFunction · 0.85
test_rulesetFunction · 0.85
unpack_rsc_orderFunction · 0.85
unpack_rsc_colocationFunction · 0.85
unpack_rsc_locationFunction · 0.85
unpack_rsc_ticketFunction · 0.85

Tested by

no test coverage detected