[pve-devel] [PATCH manager 2/2] error message on failed config dump command

Alwin Antreich a.antreich at proxmox.com
Thu May 28 16:41:57 CEST 2020


Prior Ceph Nautilus the ceph config dump command was not available.
This patch provides a more meaningful info for the user.

Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 PVE/API2/Ceph.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index afc1bdbd..fc4ee535 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -231,7 +231,8 @@ __PACKAGE__->register_method ({
 	PVE::Ceph::Tools::check_ceph_inited();
 
 	my $rados = PVE::RADOS->new();
-	my $res = $rados->mon_command( { prefix => 'config dump', format => 'json' });
+	my $res = eval { $rados->mon_command( { prefix => 'config dump', format => 'json' }) };
+	die "ceph config dump not available, $@\n" if $@;
 	foreach my $entry (@$res) {
 	    $entry->{can_update_at_runtime} = $entry->{can_update_at_runtime}? 1 : 0; # JSON::true/false -> 1/0
 	}
-- 
2.26.2





More information about the pve-devel mailing list