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

Function get_meta_attributes

lib/pengine/complex.c:110–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void
111get_meta_attributes(GHashTable * meta_hash, resource_t * rsc,
112 node_t * node, pe_working_set_t * data_set)
113{
114 GHashTable *node_hash = NULL;
115
116 if (node) {
117 node_hash = node->details->attrs;
118 }
119
120 if (rsc->xml) {
121 xmlAttrPtr xIter = NULL;
122
123 for (xIter = rsc->xml->properties; xIter; xIter = xIter->next) {
124 const char *prop_name = (const char *)xIter->name;
125 const char *prop_value = crm_element_value(rsc->xml, prop_name);
126
127 add_hash_param(meta_hash, prop_name, prop_value);
128 }
129 }
130
131 unpack_instance_attributes(data_set->input, rsc->xml, XML_TAG_META_SETS, node_hash,
132 meta_hash, NULL, FALSE, data_set->now);
133
134 /* populate from the regular attributes until the GUI can create
135 * meta attributes
136 */
137 unpack_instance_attributes(data_set->input, rsc->xml, XML_TAG_ATTR_SETS, node_hash,
138 meta_hash, NULL, FALSE, data_set->now);
139
140 /* set anything else based on the parent */
141 if (rsc->parent != NULL) {
142 g_hash_table_foreach(rsc->parent->meta, dup_attr, meta_hash);
143 }
144
145 /* and finally check the defaults */
146 unpack_instance_attributes(data_set->input, data_set->rsc_defaults, XML_TAG_META_SETS,
147 node_hash, meta_hash, NULL, FALSE, data_set->now);
148}
149
150void
151get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc,

Callers 4

dump_resource_attrFunction · 0.85
generate_resource_paramsFunction · 0.85
generate_paramsFunction · 0.85
common_unpackFunction · 0.85

Calls 3

crm_element_valueFunction · 0.85
add_hash_paramFunction · 0.85

Tested by 1

generate_paramsFunction · 0.68