HomeClusterLabs Projects

Refactor: tools: Functionize options.require_resource in crm_resource

Description

Refactor: tools: Functionize options.require_resource in crm_resource

The default is to require a resource argument. Certain commands never
require a resource argument. Some other commands can work with a
command-line config consisting of --class, --provider, and --agent.
Currently, such a command-line config is mutually exclusive with a
--resource argument.

Slight behavioral change: Previously, "crm_resource CMD --expired
--clear" required a resource, while "crm_resource CMD --clear --expired"
did not (where CMD is any option that sets a command). This is because
expired_cb() set options.require_resource to FALSE, but reset_options()
is called when cmd_clear gets set and isn't the first command.
reset_options() sets options.require_resource to TRUE.

It makes more sense for --expired --clear to behave the same as --clear
--expired in all contexts.

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

Details

Provenance
nrwahl2Authored on Feb 23 2024, 8:44 PM
Parents
rP80e5a2d963d8: Refactor: tools: Functionize options.require_node in crm_resource
Branches
Unknown
Tags
Unknown