HomeClusterLabs Projects

Low: tools: overhaul how crm_resource finds resources

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

Description

Low: tools: overhaul how crm_resource finds resources

b0ca9a11 changed uses of pe_find_resource() to pe_find_resource_with_flags()
with pe_find_renamed|pe_find_anon in crm_resource.c, but missed uses in
crm_resource_print.c and crm_resource_runtime.c, and missed that certain
commands would need different find flags.

This commit takes a holistic approach for commands that require a resource
to exist, instead of letting each command handler search for a resource. When
command-line options are parsed, find_flags is set for any such command. If
find_flags is set, crm_resource searches for the resource using those flags,
and errors if not found. The found resource can be passed to the various
functions instead of (or in addition to) the requested resource ID.

As a byproduct, this also improves a few cases. The new "just_errors" case of
clean-up now calls cli_resource_check() when a resource is specified. More
error cases are now caught.

Details

Provenance
kgaillotAuthored on Nov 9 2017, 5:41 PM

Event Timeline

Commit No Longer Exists

This commit no longer exists in the repository.