HomeClusterLabs Projects

Fix: tools: crm_error should use last rc format given

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Fix: tools: crm_error should use last rc format given

Currently, if '-X' is one of the command line options, crm_error treats
result codes as exit codes no matter what. This means that the following
option combinations all result in treating result codes as exit codes:
"-X", "-rX", "-Xr". There is no reason to specify both '-X' and '-r'.
However, if both are specified, it's reasonable to expect that the last
one "wins."

Here we replace the as_exit_code and as_rc options with a single
result_type option, which is of enum type pcmk_result_type_t and
defaults to pcmk_result_legacy. When an '-X' or '-r' option is read, it
sets the value to pcmk_result_crm_exitcode or pcmk_result_pcmk_rc,
respectively.

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

Details

Provenance
nrwahl2Authored on Sep 1 2022, 3:06 AM

Commit No Longer Exists

This commit no longer exists in the repository.