[pve-devel] [PATCH ha-manager v2 05/12] api: rules: ignore disable parameter if it is set to a falsy value
Daniel Kral
d.kral at proxmox.com
Fri Aug 1 18:22:20 CEST 2025
Otherwise, these will be ignored by the feasibility check and allows
users to create rules or update rules, which are infeasible and will
make other HA rules invalid.
Reported-by: Fiona Ebner <f.ebner at proxmox.com>
Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
src/PVE/API2/HA/Rules.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/PVE/API2/HA/Rules.pm b/src/PVE/API2/HA/Rules.pm
index d797f621..ab431019 100644
--- a/src/PVE/API2/HA/Rules.pm
+++ b/src/PVE/API2/HA/Rules.pm
@@ -268,6 +268,8 @@ __PACKAGE__->register_method({
my $type = extract_param($param, 'type');
my $ruleid = extract_param($param, 'rule');
+ delete $param->{disable} if !$param->{disable};
+
my $plugin = PVE::HA::Rules->lookup($type);
my $opts = $plugin->check_config($ruleid, $param, 1, 1);
@@ -318,6 +320,8 @@ __PACKAGE__->register_method({
my $digest = extract_param($param, 'digest');
my $delete = extract_param($param, 'delete');
+ delete $param->{disable} if !$param->{disable};
+
if ($delete) {
$delete = [PVE::Tools::split_list($delete)];
}
--
2.47.2
More information about the pve-devel
mailing list