HomeClusterLabs Projects

Refactor: tools: guard crm_resource actions with booleans rather than comparing…

Description

Refactor: tools: guard crm_resource actions with booleans rather than comparing rsc_cmd

Previously, crm_resource's main() decided whether to perform certain actions
(such as ensure --resource exists) by checking rsc_cmd directly. Because the
planned --wait option will not have a distinct rsc_cmd, these comparisons
would get unwieldy, so instead it now checks booleans, and each command
can set the booleans it needs.

By its nature this also gets rid of some dead code; some of the previous
guards checked whether rsc_cmd != 'P', but that was always true (the 'P'
flag sets rsc_cmd = 'C', and nothing sets rsc_cmd = 'P'). The new booleans
maintain the actual behavior of the previous code.

Details

Provenance
kgaillotAuthored on Mar 5 2015, 4:41 PM
Parents
rPcfefd79975e2: Refactor: tools: functionize working set logic in crm_resource
Branches
Unknown
Tags
Unknown

Event Timeline