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.eb...@proxmox.com>
Signed-off-by: Daniel Kral <d.k...@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to