[pve-devel] [PATCH manager 3/5] task log: set default in the api call

Dominik Csapak d.csapak at proxmox.com
Wed Jun 27 14:06:17 CEST 2018


we have the defaults documented here, so set them here too
otherwise if the default change in PVE::Tools, we probably forget to
update the api description

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Tasks.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Tasks.pm b/PVE/API2/Tasks.pm
index ec36f4b6..1395b6b9 100644
--- a/PVE/API2/Tasks.pm
+++ b/PVE/API2/Tasks.pm
@@ -267,15 +267,17 @@ __PACKAGE__->register_method({
 	my $rpcenv = PVE::RPCEnvironment::get();
 	my $user = $rpcenv->get_user();
 	my $node = $param->{node};
+	my $start = $param->{start} // 0;
+	my $limit = $param->{limit} // 50;
 
 	if ($user ne $task->{user})  {
 	    $rpcenv->check($user, "/nodes/$node", [ 'Sys.Audit' ]);
 	}
 
-	my ($count, $lines) = PVE::Tools::dump_logfile($filename, $param->{start}, $param->{limit});
+	my ($count, $lines) = PVE::Tools::dump_logfile($filename, $start, $limit);
 
 	$rpcenv->set_result_attrib('total', $count);
-	    
+
 	return $lines;
     }});
 
-- 
2.11.0




More information about the pve-devel mailing list