all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common] job registry: remove id property
Date: Tue, 15 Nov 2022 11:18:30 +0100	[thread overview]
Message-ID: <20221115101830.59803-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20221115101830.59803-1-f.ebner@proxmox.com>

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 <f.ebner@proxmox.com>
---
 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





  reply	other threads:[~2022-11-15 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 10:18 [pve-devel] [PATCH manager] api: backup: auto-inject job id where expected by the API Fiona Ebner
2022-11-15 10:18 ` Fiona Ebner [this message]
2022-11-15 10:27 ` Fiona Ebner
2022-11-15 12:30 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221115101830.59803-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal