projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8587474
)
PVE::CLIHandler::print_api_list - improve format check
author
Dietmar Maurer
<dietmar@proxmox.com>
Fri, 22 Jun 2018 05:18:41 +0000
(07:18 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Fri, 22 Jun 2018 05:32:33 +0000
(07:32 +0200)
We can only print lists of objects.
src/PVE/CLIHandler.pm
patch
|
blob
|
history
diff --git
a/src/PVE/CLIHandler.pm
b/src/PVE/CLIHandler.pm
index
a9ebc47
..
41ac6c2
100644
(file)
--- a/
src/PVE/CLIHandler.pm
+++ b/
src/PVE/CLIHandler.pm
@@
-495,7
+495,8
@@
sub print_text_table {
sub print_api_list {
my ($data, $returninfo, $props_to_print) = @_;
- die "can only print array result" if $returninfo->{type} ne 'array';
+ die "can only print object lists\n"
+ if !($returninfo->{type} eq 'array' && $returninfo->{items}->{type} eq 'object');
my $returnprops = $returninfo->{items}->{properties};