From 2edb0abbb9165e072357a0e4b2ecc564225de662 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 22 Jun 2018 07:18:41 +0200 Subject: [PATCH] PVE::CLIHandler::print_api_list - improve format check We can only print lists of objects. --- src/PVE/CLIHandler.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}; -- 2.39.2