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

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jun 2 14:05:26 CEST 2020


On 5/28/20 4:41 PM, Alwin Antreich wrote:
> Prior Ceph Nautilus the ceph config dump command was not available.
> This patch provides a more meaningful info for the user.
> 

what is the verbatim error message you get from ceph in that case?

As you're now assuming that any error is dump not available, even if
it could be something totally different?

> 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
>  	}
> 





More information about the pve-devel mailing list