From 82755d971d8ceead6e833fd6c38d68de53133f24 Mon Sep 17 00:00:00 2001 From: Tomas Jelinek Date: Wed, 10 Jun 2026 10:31:52 +0200 Subject: [PATCH] fix removing rule constraints in web UI --- CHANGELOG.md | 3 +++ pcs/cli/constraint/command.py | 2 ++ pcsd/pcs.rb | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce68592ea..bc5e3f199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ - `pcs constraint config` (and its variants for each constraint type) now list resources in sets in the order defined in the CIB, instead of sorting them alphabetically ([rhbz#2461143]) ([RHEL-176475]) +- Location constraints with rules can be removed using web UI (broken since + pcs-0.12.0b1) ([RHEL-183182]) ### Deprecated - Commands `pcs pcsd certkey` and `pcs pcsd sync-certificates` ([RHEL-149608]) @@ -37,6 +39,7 @@ [RHEL-149608]: https://issues.redhat.com/browse/RHEL-149608 [RHEL-169571]: https://redhat.atlassian.net/browse/RHEL-169571 [RHEL-176475]: https://redhat.atlassian.net/browse/RHEL-176475 +[RHEL-183182]: https://redhat.atlassian.net/browse/RHEL-183182 [rhbz#2458608]: https://bugzilla.redhat.com/show_bug.cgi?id=2458608 [rhbz#2461143]: https://bugzilla.redhat.com/show_bug.cgi?id=2461143 diff --git a/pcs/cli/constraint/command.py b/pcs/cli/constraint/command.py index 9677fd3c8..cc1fb7410 100644 --- a/pcs/cli/constraint/command.py +++ b/pcs/cli/constraint/command.py @@ -52,6 +52,8 @@ def remove(lib: Any, argv: Argv, modifiers: InputModifiers) -> None: raise CmdLineInputError() ensure_unique_args(argv) constraints_dto = lib.constraint.get_config(evaluate_rules=False) + # /remote/remove_constraint_rule_remote url depends on the fact that rules + # in location constraints are allowed here as well missing_ids = set(argv) - ( get_all_constraints_ids(constraints_dto) | get_all_location_rules_ids(constraints_dto) diff --git a/pcsd/pcs.rb b/pcsd/pcs.rb index 13ba29631..32373f344 100644 --- a/pcsd/pcs.rb +++ b/pcsd/pcs.rb @@ -152,8 +152,10 @@ def remove_constraint(auth_user, constraint_id) end def remove_constraint_rule(auth_user, rule_id) + # CLI command for removing rules no longer exists in pcs-0.12. Command for + # removing constraints is capable of handling that, though. stdout, stderror, retval = run_cmd( - auth_user, PCS, "--", "constraint", "rule", "remove", rule_id + auth_user, PCS, "--", "constraint", "remove", rule_id ) $logger.info stdout return retval