mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 18:30:17 +00:00
correctly print string return values
This commit is contained in:
parent
e09058af9a
commit
f28d0dcfba
12
bin/pvesh
12
bin/pvesh
@ -224,8 +224,16 @@ sub call_method {
|
|||||||
|
|
||||||
warn "200 OK\n"; # always print OK status if successful
|
warn "200 OK\n"; # always print OK status if successful
|
||||||
|
|
||||||
return if $info && $info->{returns} &&
|
if ($info && $info->{returns} && $info->{returns}->{type}) {
|
||||||
$info->{returns}->{type} && $info->{returns}->{type} eq 'null';
|
my $rtype = $info->{returns}->{type};
|
||||||
|
|
||||||
|
return if $rtype eq 'null';
|
||||||
|
|
||||||
|
if ($rtype eq 'string') {
|
||||||
|
print $data;
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print to_json($data, {allow_nonref => 1, canonical => 1, pretty => 1 });
|
print to_json($data, {allow_nonref => 1, canonical => 1, pretty => 1 });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user