HomeClusterLabs Projects

Refactor: libcrmcommon: new internal API for action results

Description

Refactor: libcrmcommon: new internal API for action results

Create a new object (with accessor functions) for the result of an externally
executed action, pcmk__action_result_t, with:

  • the child's exit status, stdout, and stderr
  • Pacemaker's execution status for the action (completed, timed out, etc.)
  • a human-friendly description (a.k.a. exit reason)

We have multiple existing objects that have similar members. Using a common
object will reduce duplication, and also encourage setting an exit reason
whenever setting a result, to ensure we have exit reasons whenever possible.

Nothing uses the new API as of this commit, but lrmd_cmd_t and remote_ra_cmd_t
will be refactored to use it. Eventually, lrmd_event_data_t and svc_action_t
should use it as well, but those are public API and will have to wait for a
backward compatibility break.

Details

Provenance
kgaillotAuthored on Jun 1 2021, 6:14 PM
Parents
rPcdb216ceb796: Merge pull request #2507 from kgaillot/best-practices
Branches
Unknown
Tags
Unknown

Event Timeline