HomeClusterLabs Projects

Refactor: tools: Drop agent_spec_cb from crm_resource

Description

Refactor: tools: Drop agent_spec_cb from crm_resource

It was added recently as a temporary placeholder to clean things up a
bit. Now it's part of a new command_cb().

We've been gravitating toward string comparison chains like this instead
of small callback functions that do similar things. The latter is more
efficient (since the former repeats work) and I weakly prefer it (or
even one callback per option, plus helpers!). However, for CLI option
parsing the efficiency doesn't really matter.

This will collect all the assignments to options.rsc_cmd into one place.
All except one of the cases (cmd_execute_agent) are short and have very
simple side effects. The cmd_execute_agent case (for --validate and
--force-*) is still reasonably short, so I will include it to avoid
having one special case callback.

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

Details

Provenance
nrwahl2Authored on Feb 28 2024, 11:18 AM
Parents
rPd1b5ba1e9d84: Refactor: tools: Use default command in crm_resource
Branches
Unknown
Tags
Unknown