mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 05:22:40 +00:00
pvesh: proxy : display result if not json
When a remote node not return a json, we got and error. This is fixing this: pvesh set /nodes/localname/network UPID:kvmformation2:0034937B:09352894:5E41106C:srvreload:networking:root@pam: pvesh set /nodes/remotenode/network JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/share/perl5/PVE/CLI/pvesh.pm line 125. This patch simply return raw result if it's not a json Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
df2d3636f4
commit
a84a2ae8c5
@ -122,7 +122,14 @@ sub proxy_handler {
|
||||
PVE::Tools::run_command($remcmd, errmsg => "proxy handler failed",
|
||||
outfunc => sub { $json .= shift });
|
||||
|
||||
return decode_json($json);
|
||||
my $decoded_json = undef;
|
||||
eval {
|
||||
$decoded_json = decode_json($json);
|
||||
};
|
||||
if ($@) {
|
||||
return $json;
|
||||
}
|
||||
return $decoded_json;
|
||||
}
|
||||
|
||||
sub extract_children {
|
||||
|
Loading…
Reference in New Issue
Block a user