file-restore: return perl-y booleans
like we do in most of our API. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
f1a3ce3b17
commit
82f764e119
@ -56,7 +56,7 @@ __PACKAGE__->register_method ({
|
|||||||
},
|
},
|
||||||
leaf => {
|
leaf => {
|
||||||
description => "If this entry is a leaf in the directory graph.",
|
description => "If this entry is a leaf in the directory graph.",
|
||||||
type => 'any', # JSON::PP::Boolean gets passed through
|
type => 'boolean',
|
||||||
},
|
},
|
||||||
size => {
|
size => {
|
||||||
description => "Entry file size.",
|
description => "Entry file size.",
|
||||||
@ -91,6 +91,13 @@ __PACKAGE__->register_method ({
|
|||||||
my $client = PVE::PBSClient->new($scfg, $storeid);
|
my $client = PVE::PBSClient->new($scfg, $storeid);
|
||||||
my $ret = $client->file_restore_list($snap, $path, $base64);
|
my $ret = $client->file_restore_list($snap, $path, $base64);
|
||||||
|
|
||||||
|
|
||||||
|
# 'leaf' is a proper JSON boolean, map to perl-y bool
|
||||||
|
# TODO: make PBSClient decode all bools always as 1/0?
|
||||||
|
foreach my $item (@$ret) {
|
||||||
|
$item->{leaf} = $item->{leaf} ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user