| 53 | enum pe_ordering get_asymmetrical_flags(enum pe_order_kind kind); |
| 54 | |
| 55 | gboolean |
| 56 | unpack_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 | |
| 102 | static const char * |
| 103 | invert_action(const char *action) |
no test coverage detected