From: Dietmar Maurer Date: Fri, 22 Jun 2018 05:18:41 +0000 (+0200) Subject: PVE::CLIHandler::print_api_list - improve format check X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=2edb0abbb9165e072357a0e4b2ecc564225de662;hp=8587474c3619a41c3bf73c54d5979fe055188314 PVE::CLIHandler::print_api_list - improve format check We can only print lists of objects. --- diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index a9ebc47..41ac6c2 100644 --- 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};