HomeClusterLabs Projects

Feature: tools: Use formatted output in crm_diff.c
e15dc0995367Unpublished

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

Feature: tools: Use formatted output in crm_diff.c

It's a shame that the pcmk__output_t:output_xml() method requires
preformatting the XML into a string. Since it's an internal API, maybe
we can revisit that soon.

Perhaps we should use "patchset" as the root element name for the
response, since "diff" is already used as the root element name for the
patchset itself. I would have preferred to use "patchset" as the root
element name for patchsets, but I don't think I was around when that
decision was made.

Also, we already have a diff schema in xml/api. We could use it and
output the patchset XML directly, instead of outputting the patchset XML
as CDATA. Ken was pretty adamant about outputting CDATA here. I don't
know why, or can't remember. The argument can't be that the XML isn't
generated by crm_diff itself, because that's true for almost all of our
output formatters. Something about how the format is supposed to be
meaningful only to Pacemaker... though I don't see why that ought to be
the case.

I'm fine with CDATA, regardless.

TODO:

  • Add API schema for crm_diff.
  • Ideally add some cts-cli tests.

Closes T114

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

Details

Provenance
nrwahl2Authored on Mar 18 2025, 3:09 AM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.