[pve-devel] [PATCH manager 2/2] error message on failed config dump command
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Jun 2 15:53:03 CEST 2020
On 6/2/20 2:57 PM, Alwin Antreich wrote:
> On Tue, Jun 02, 2020 at 02:05:26PM +0200, Thomas Lamprecht wrote:
>> 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?
> It said: __mon_command failed - command not known (500)__. I just want
> to give a clearer message, not that the mon_command is not known.
>
Hmm OK, I'd actually improve this then in our librados perl XS wrapper,
i.e., with:
diff --git a/PVE/RADOS.pm b/PVE/RADOS.pm
index 11af8a6..463abc7 100644
--- a/PVE/RADOS.pm
+++ b/PVE/RADOS.pm
@@ -265,7 +265,8 @@ sub mon_command {
my $json = encode_json($cmd);
- my $raw = &$sendcmd($self, 'M', $json);
+ my $raw = eval { $sendcmd->($self, 'M', $json) };
+ die "error with '$cmd->{prefix}': $@" if $@;
if ($cmd->{format} && $cmd->{format} eq 'json') {
return length($raw) ? decode_json($raw) : undef;
More information about the pve-devel
mailing list