From e7e615768f7e9c6e32cb97fc9963ea1654d9de4f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 18 Jun 2019 15:42:48 +0200 Subject: [PATCH] ceph: services: do not create rados object in get_services_info we always gave one, and the only reason why it could be undef is that we could not connect, so it makes no sense to try again and add unecessary time to the api call Signed-off-by: Dominik Csapak --- PVE/Ceph/Services.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/Ceph/Services.pm b/PVE/Ceph/Services.pm index 1a980136..bcdb39ee 100644 --- a/PVE/Ceph/Services.pm +++ b/PVE/Ceph/Services.pm @@ -107,8 +107,9 @@ sub get_services_info { } if (!$rados) { - $rados = PVE::RADOS->new(); + return $result; } + my $metadata = $rados->mon_command({ prefix => "$type metadata" }); foreach my $info (@$metadata) { my $id = $info->{name} // $info->{id};