[pve-devel] [PATCH pve-manager 2/2] ceph: mon: adapt code style in mon removal assertion

Max Carrara m.carrara at proxmox.com
Wed Mar 13 15:53:45 CET 2024


Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
 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 1737c294..f13115a0 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 { exists($_->{name}) && $_->{name} eq $monid } @$monlist))
+	  grep { exists($_->{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





More information about the pve-devel mailing list