HomeClusterLabs Projects

Refactor: tools: Use the handler return codes in cibsecret.

Description

Refactor: tools: Use the handler return codes in cibsecret.

Instead of having both a return code and an exit code as an out
parameter, we can just use the return code and convert it to an exit
code at the end. My original thinking here was that this was necessary
to preserve backwards compatibility with cibsecret.in. However, this
does not turn out to be the case:

  • In several spots, the return code maps to the same exit code that cibsecret.in was returning. For example, whatever we're returning that maps to CRM_EX_NOSUCH is handled by this.
  • In a couple other places, changing the return value from the handler is good enough to map to the right exit code.
  • A couple places can be handled by returning pcmk_rc_unpack_error. I don't really like this, but it's consistent with how we are returning that error elsewhere. See code comments.

Details

Provenance
clumensAuthored on Fri, Sep 12, 1:35 PM
Parents
rP9dd2fcf72d7f: API: libcrmcommon: Add pcmk_rc_digest_mismatch error code.
Branches
Unknown
Tags
Unknown