HomeClusterLabs Projects

Refactor: scheduler: remove redundant code in generate_location_rule()

Description

Refactor: scheduler: remove redundant code in generate_location_rule()

The function created a list of nodes that a single rule in the constraint
applies to in two ways:

  1. For boolean-op="and", it started by making a copy of all nodes in the cluster, then removed all nodes for which the rule fails.
  1. For boolean-op="or", it started with an empty list, then added all nodes for which the rule passes.

These produce the exact same list. It is hard to imagine what misunderstanding
even led to the design. Use the same method for both.

Also, pcmk_evaluate_rule() already trace-logs its result, so we don't need to
do it again here.

Details

Provenance
kgaillotAuthored on Mar 19 2024, 7:59 PM
Parents
rP50fe06984b05: Refactor: scheduler: make generate_location_rule() take pcmk_rule_input_t
Branches
Unknown
Tags
Unknown