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 UTF8SMTPS id E1FA768B7B for ; Fri, 4 Dec 2020 12:31:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with UTF8SMTP id D295498DD for ; Fri, 4 Dec 2020 12:30:56 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with UTF8SMTPS id 09CA098CF for ; Fri, 4 Dec 2020 12:30:55 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with UTF8SMTP id A33A744CEE; Fri, 4 Dec 2020 12:30:54 +0100 (CET) To: Thomas Lamprecht , Proxmox VE development discussion References: <20201202092113.15911-1-d.csapak@proxmox.com> <20201202092113.15911-4-d.csapak@proxmox.com> <3434720d-ee6f-9d7d-a365-2a497e27c70f@proxmox.com> From: Dominik Csapak Message-ID: <4e1b5832-9271-6bab-31c6-d1705afb7409@proxmox.com> Date: Fri, 4 Dec 2020 12:30:53 +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: <3434720d-ee6f-9d7d-a365-2a497e27c70f@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.295 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: Fri, 04 Dec 2020 11:31:26 -0000 On 12/3/20 10:05 AM, Thomas Lamprecht wrote: > On 02.12.20 10:21, Dominik Csapak wrote: >> like we do in other apis of section configs (e.g. storage) >> >> Signed-off-by: Dominik Csapak >> --- >> PVE/API2/Cluster/MetricServer.pm | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/PVE/API2/Cluster/MetricServer.pm b/PVE/API2/Cluster/MetricServer.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 = $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}); >> >> delete $data->{$k}; >> } >> > > That counts as API change, strictly speaking.. ok, so should we leave it as is for now? > For container and VMs we order > deletions before setting the value, and the one from container is the last > 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 universal, > as else this is confusing.. > yeah that makes sense (though i think the ordering is irrelevant, since even in container you cannot set and delete at the same time)