From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 8CB7E1FF0E0 for ; Thu, 09 Jul 2026 14:02:09 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 27EF721925; Thu, 09 Jul 2026 13:58:30 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com, pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs 25/29] notify: add 'migrate_to_expression' parameter for get_matcher Date: Thu, 9 Jul 2026 13:57:12 +0200 Message-ID: <20260709115716.299836-26-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260709115716.299836-1-l.wagner@proxmox.com> References: <20260709115716.299836-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783598240667 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: XSGORH3GVQRIG4PHKH2UK2TGELB4JC4L X-Message-ID-Hash: XSGORH3GVQRIG4PHKH2UK2TGELB4JC4L X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: If set, we return the matcher with any occurrences of the 'old' match-*, invert-match and mode keys to an equivalent expression. Signed-off-by: Lukas Wagner --- common/src/bindings/notify.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/bindings/notify.rs b/common/src/bindings/notify.rs index 80ccf39..3b9c613 100644 --- a/common/src/bindings/notify.rs +++ b/common/src/bindings/notify.rs @@ -464,9 +464,14 @@ pub mod proxmox_rs_notify { pub fn get_matcher( #[try_from_ref] this: &NotificationConfig, id: &str, + migrate_to_expression: bool, ) -> Result { let config = this.config.lock().unwrap(); - api::matcher::get_matcher(&config, id) + if migrate_to_expression { + api::matcher::get_matcher_as_expression(&config, id) + } else { + api::matcher::get_matcher(&config, id) + } } /// Method: Add a matcher. -- 2.47.3