[pve-devel] [pve-manager cli cleanup 1/4] pvenode task log: use print_api_result_plain

Dietmar Maurer dietmar at proxmox.com
Thu Aug 9 11:43:36 CEST 2018


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/CLI/pvenode.pm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index 5cd855be..bba45229 100644
--- a/PVE/CLI/pvenode.pm
+++ b/PVE/CLI/pvenode.pm
@@ -177,11 +177,9 @@ our $cmddef = {
 	}, $PVE::RESTHandler::standard_output_options],
 	# set limit to 1000000, so we see the whole log, not only the first 50 lines by default
 	log => [ 'PVE::API2::Tasks', 'read_task_log', [ 'upid' ], { node => $nodename, limit => 1000000 }, sub {
-	    my ($data, $resultprops) = @_;
-	    foreach my $line (@$data) {
-		print $line->{t} . "\n";
-	    }
-	}],
+	    my ($data, $schema, $options) = @_;
+	    PVE::CLIFormatter::print_api_result_plain($data, $schema, ['t'], $options);
+	}, $PVE::RESTHandler::standard_output_options],
     },
 
     acme => {
-- 
2.11.0




More information about the pve-devel mailing list