diff --git a/lib/common/patchset.c b/lib/common/patchset.c index fae7046..46d136a 100644 --- a/lib/common/patchset.c +++ b/lib/common/patchset.c @@ -279,15 +279,10 @@ xml_repair_v1_diff(xmlNode *last, xmlNode *next, xmlNode *local_diff, crm_xml_add(diff_child, vfields[lpc], value); } - if (next) { - xmlAttrPtr xIter = NULL; + for (xmlAttrPtr a = pcmk__xe_first_attr(next); a != NULL; a = a->next) { + const char *p_value = crm_element_value(next, (const char *) a->name); - for (xIter = next->properties; xIter; xIter = xIter->next) { - const char *p_name = (const char *) xIter->name; - const char *p_value = crm_element_value(next, p_name); - - xmlSetProp(cib, (pcmkXmlStr) p_name, (pcmkXmlStr) p_value); - } + xmlSetProp(cib, a->name, (pcmkXmlStr) p_value); } crm_log_xml_explicit(local_diff, "Repaired-diff"); diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c index 7eb49f7..f3c696a 100644 --- a/lib/pengine/complex.c +++ b/lib/pengine/complex.c @@ -119,15 +119,11 @@ get_meta_attributes(GHashTable * meta_hash, pe_resource_t * rsc, rule_data.node_hash = node->details->attrs; } - if (rsc->xml) { - xmlAttrPtr xIter = NULL; + for (xmlAttrPtr a = pcmk__xe_first_attr(rsc->xml); a != NULL; a = a->next) { + const char *prop_name = (const char *) a->name; + const char *prop_value = crm_element_value(rsc->xml, prop_name); - for (xIter = rsc->xml->properties; xIter; xIter = xIter->next) { - const char *prop_name = (const char *)xIter->name; - const char *prop_value = crm_element_value(rsc->xml, prop_name); - - add_hash_param(meta_hash, prop_name, prop_value); - } + add_hash_param(meta_hash, prop_name, prop_value); } pe__unpack_dataset_nvpairs(rsc->xml, XML_TAG_META_SETS, &rule_data,