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 066FC61626 for ; Thu, 3 Dec 2020 10:05:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E638F24E6C for ; Thu, 3 Dec 2020 10:05:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 id 80D6E24E62 for ; Thu, 3 Dec 2020 10:05:25 +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 457B84474D for ; Thu, 3 Dec 2020 10:05:25 +0100 (CET) To: Proxmox VE development discussion , Dominik Csapak References: <20201202092113.15911-1-d.csapak@proxmox.com> <20201202092113.15911-4-d.csapak@proxmox.com> From: Thomas Lamprecht Message-ID: <3434720d-ee6f-9d7d-a365-2a497e27c70f@proxmox.com> Date: Thu, 3 Dec 2020 10:05:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <20201202092113.15911-4-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.074 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [metricserver.pm] Subject: Re: [pve-devel] [PATCH manager 1/7] api: cluster/metricserver: prevent simultaneosly setting and deleting of 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: Thu, 03 Dec 2020 09:05:56 -0000 On 02.12.20 10:21, Dominik Csapak wrote: > like we do in other apis of section configs (e.g. storage) >=20 > Signed-off-by: Dominik Csapak > --- > PVE/API2/Cluster/MetricServer.pm | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/PVE/API2/Cluster/MetricServer.pm b/PVE/API2/Cluster/Metric= Server.pm > index 9a14985e..ec3c7b75 100644 > --- a/PVE/API2/Cluster/MetricServer.pm > +++ b/PVE/API2/Cluster/MetricServer.pm > @@ -213,6 +213,8 @@ __PACKAGE__->register_method ({ > my $d =3D $options->{$k} || die "no such option '$k'\n"; > die "unable to delete required option '$k'\n" if !$d->{optional}= ; > die "unable to delete fixed option '$k'\n" if $d->{fixed}; > + die "cannot set and delete property '$k' at the same time!\n" > + if defined($opts->{$k}); > =20 > delete $data->{$k}; > } >=20 That counts as API change, strictly speaking.. For container and VMs we o= rder deletions before setting the value, and the one from container is the las= t one which got some actual thoughts and discussion going on, IIRC, albeit = not to sure if about that exact behavior (as it was probably pre-existing). It'd be good to at least decide for one behavior and try making that univ= ersal, as else this is confusing..