HomeClusterLabs Projects

Low: pengine: avoid sisyphean score-attribute-mangled parsing

Description

Low: pengine: avoid sisyphean score-attribute-mangled parsing

(following the discussion of preceding-but-one commit 30383cc)

Commit f722c9f introduced score-attribute-mangle (sic) but it was likely
meant (as score-attribute-mangled, along with plain score-attribute)
for the rule element of the resulting RNG schema for validating
the CIB XML representation. In fact, score-attribute arrived at that
destination as of the same commit.

At that time, score-attribute-mangled had no use, which changed as
of ea1359b, which also explains (and perhaps validates) the formerly
stated speculation. The part of the code in question uses
score-attribute-mangled as a fallback for when score-attribute
(and score, in the first place!) is not defined, i.e., it can be
considered a weak alias for score-attribute (but not for plain
score as the treatment differs).

Nonetheless, this weak alias was hardly ever in use as it would not
pass the internal validation (the respective schemas never allowed
such a constellation). Hence, this effectively dead-code gets dropped
and, in turn, the code-schemas divergence rectified with this commit.
What's kept around is XML_RULE_ATTR_SCORE_MANGLED defined literal
for the title parameter as it wouldn't be too nice to change the
public API, at least until the whole thing settles down a bit
(thanks Ken for pointing this out).

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Jul 20 2016, 9:56 AM
Parents
rP83c8af4af43c: xml: fix CIB in pengine test that used rsc_colocation/@score-attribute
Branches
Unknown
Tags
Unknown

Event Timeline