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 3F391B9695 for ; Thu, 14 Mar 2024 11:20:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 204E6A4F2 for ; Thu, 14 Mar 2024 11:19:39 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 14 Mar 2024 11:19:38 +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 C70AC489C4 for ; Thu, 14 Mar 2024 11:19:37 +0100 (CET) From: Max Carrara To: pve-devel@lists.proxmox.com Date: Thu, 14 Mar 2024 11:19:30 +0100 Message-Id: <20240314101930.198214-2-m.carrara@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240314101930.198214-1-m.carrara@proxmox.com> References: <20240314101930.198214-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.491 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLACK 3 Contains an URL listed in the URIBL blacklist [mon.pm] Subject: [pve-devel] [PATCH v2 pve-manager 2/2] ceph: mon: adapt code style in mon removal assertion 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, 14 Mar 2024 10:20:09 -0000 Signed-off-by: Max Carrara --- PVE/API2/Ceph/MON.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm index 057ca70d..d5b219bf 100644 --- a/PVE/API2/Ceph/MON.pm +++ b/PVE/API2/Ceph/MON.pm @@ -148,13 +148,13 @@ my $assert_mon_can_remove = sub { my ($monhash, $monlist, $monid, $mondir) = @_; if (!(defined($monhash->{$monid}) || - grep { defined($_->{name}) && $_->{name} eq $monid } @$monlist)) + grep { defined($_->{name}) && $_->{name} eq $monid } $monlist->@*)) { die "no such monitor id '$monid'\n" } die "monitor filesystem '$mondir' does not exist on this node\n" if ! -d $mondir; - die "can't remove last monitor\n" if scalar(@$monlist) <= 1; + die "can't remove last monitor\n" if scalar($monlist->@*) <= 1; }; my $remove_addr_from_mon_host = sub { -- 2.39.2