HomeClusterLabs Projects

Refactor: libcrmcommon: New pcmk__xpath_result_element()
047b2848ee0eUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Refactor: libcrmcommon: New pcmk__xpath_result_element()

To replace getXpathResult().

It would be simpler to just get the result node, regardless of type. I
suspect that all internal callers pass XPath expressions that could only
match element nodes anyway. However, the "get nearest reasonable
element" logic is now necessary for backward compatibility. At the very
least, the public CIB API (with cib_xpath) and cibadmin (with --xpath)
use this logic.

The decision to return elements for non-element matches in the first
place (commits 2b2f705 and d596d67) is highly questionable, and as
usual no justification was provided.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 10 2025, 7:58 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.