From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6EFC91FF186 for ; Fri, 1 Aug 2025 18:22:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5EC8A1E661; Fri, 1 Aug 2025 18:23:10 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Fri, 1 Aug 2025 18:22:20 +0200 Message-ID: <20250801162230.296214-6-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250801162230.296214-1-d.kral@proxmox.com> References: <20250801162230.296214-1-d.kral@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754065339904 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.014 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH ha-manager v2 05/12] api: rules: ignore disable parameter if it is set to a falsy value X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 Signed-off-by: Daniel Kral --- 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