From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 063BC8223 for ; Tue, 15 Nov 2022 11:18:37 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DDA7BD47 for ; Tue, 15 Nov 2022 11:18:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 15 Nov 2022 11:18:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 06DA343DB1 for ; Tue, 15 Nov 2022 11:18:36 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 15 Nov 2022 11:18:30 +0100 Message-Id: <20221115101830.59803-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221115101830.59803-1-f.ebner@proxmox.com> References: <20221115101830.59803-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: =?UTF-8?Q?0=0A=09?=AWL 0.027 Adjusted score from AWL reputation of From: =?UTF-8?Q?address=0A=09?=BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict =?UTF-8?Q?Alignment=0A=09?=SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF =?UTF-8?Q?Record=0A=09?=SPF_PASS -0.001 SPF: sender matches SPF =?UTF-8?Q?record=0A=09?=URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [jobbase.pm, registry.pm] Subject: [pve-devel] [PATCH common] job registry: remove id property 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: , X-List-Received-Date: Tue, 15 Nov 2022 10:18:37 -0000 Since VZDump/JobBase.pm in guest-common doesn't declare that it has an option 'id', this is unused anyway and the auto-inject logic wouldn't trigger. Alternatively, the 'id' option could be added in VZDump/JobBase.pm (as optional, because existing jobs.cfg don't contain the id as a property within the section), but it would lead to the id being written to the section in write_config, which is not nice at all as the id is already in the header. Signed-off-by: Fiona Ebner --- src/PVE/Job/Registry.pm | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/PVE/Job/Registry.pm b/src/PVE/Job/Registry.pm index 32e0272..03bed5e 100644 --- a/src/PVE/Job/Registry.pm +++ b/src/PVE/Job/Registry.pm @@ -18,14 +18,6 @@ use base qw(PVE::SectionConfig); my $defaultData = { propertyList => { type => { description => "Section type." }, - # FIXME: remove below? this is the section ID, schema would only be checked if a plugin - # declares this as explicit option, which isn't really required as its available anyway.. - id => { - description => "The ID of the job.", - type => 'string', - format => 'pve-configid', - maxLength => 64, - }, enabled => { description => "Determines if the job is enabled.", type => 'boolean', @@ -66,11 +58,6 @@ sub parse_config { my $data = $cfg->{ids}->{$id}; my $type = $data->{type}; - # FIXME: below id injection is gross, guard to avoid breaking plugins that don't declare id - # as option; *iff* we want this it should be handled by section config directly. - if ($defaultData->{options}->{$type} && exists $defaultData->{options}->{$type}->{id}) { - $data->{id} = $id; - } $data->{enabled} //= 1; $data->{comment} = PVE::Tools::decode_text($data->{comment}) if defined($data->{comment}); -- 2.30.2