[pve-devel] [PATCH manager 04/14] ceph: services: do not create rados object in get_services_info

Dominik Csapak d.csapak at proxmox.com
Tue Jun 18 15:42:48 CEST 2019


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 <d.csapak at proxmox.com>
---
 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};
-- 
2.11.0





More information about the pve-devel mailing list