HomeClusterLabs Projects

Low: xml diff'ing: prevent 'id' attribute reordering in "diff-removed"

Description

Low: xml diff'ing: prevent 'id' attribute reordering in "diff-removed"

While the order of attributes within XML doesn't matter as codified in
standard, pacemaker makes a naive simplification, abusing the
implementation detail of libxml2, that it does in most of the places,
so it's rather surprising there are cases not abiding that philosophy,
like prior to this patch:

$ grep '.*' old new

old:<foo>
old: <bar id='uniquestuff' startku='jemocdobra'/>
old:</foo>
new:<foo>
new: <bar id='uniquestuff' startku='nekourim'/>
new:</foo>

$ crm_diff -o old -n new

<diff crm_feature_set="3.1.0" format="1" digest="d75f709e3a6f8b9d2480d02feadbcdd4">

<diff-removed>
  <foo>
    <bar startku="jemocdobra" id="uniquestuff"/>
  </foo>
  <cib/>
</diff-removed>
<diff-added>
  <foo>
    <bar id="uniquestuff" startku="nekourim"/>
  </foo>
  <cib/>
</diff-added>

</diff>

See also:
https://bugzilla.redhat.com/show_bug.cgi?id=1561617#c7

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Sep 26 2018, 8:58 AM
Parents
rPccc4c6a94a34: Low: libcrmcommon: downplay "Creating RNG parser context" as debug prio
Branches
Unknown
Tags
Unknown

Event Timeline