HomeClusterLabs Projects

Refactor: scheduler: functionize parsing role in location constraints

Description

Refactor: scheduler: functionize parsing role in location constraints

Previously, generate_location_rule() (for location constraints with rules)
and unpack_rsc_location() (for simple location constraints) duplicated code for
parsing and validating roles. This is now functionized into
parse_location_role().

This preserves some questionable behavior for backward compatibility. For
rule-based location constraints, an invalid role currently and correctly
causes the entire constraint to be ignored. However if a regular location
constraint has an invalid role, unpack_rsc_location() logs an "Invalid
constraint" message but still creates the constraint ignoring the role.

Details

Provenance
kgaillotAuthored on Oct 17 2023, 6:16 PM
Parents
rP4967551ddfd6: Refactor: scheduler: drop pe_err() and pe_warn()
Branches
Unknown
Tags
Unknown