From a05db8b5dd4af72397d774371b7e6af4dfad02da Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 10 Jul 2018 13:51:28 +0200 Subject: [PATCH] print_api_result: skip undefined object values MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We use objects to return VM configurations, so we uónly want to display defined values. Signed-off-by: Dietmar Maurer --- src/PVE/CLIFormatter.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm index 927e5a6..7a92f7a 100644 --- a/src/PVE/CLIFormatter.pm +++ b/src/PVE/CLIFormatter.pm @@ -393,6 +393,7 @@ sub print_api_result { $props_to_print = [ sort keys %$data ] if !scalar(@$props_to_print); my $kvstore = []; foreach my $key (@$props_to_print) { + next if !defined($data->{$key}); push @$kvstore, { key => $key, value => data_to_text($data->{$key}, $result_schema->{properties}->{$key}, $options) }; } my $schema = { type => 'array', items => { type => 'object' }}; -- 2.39.2