public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dylan Whyte <d.whyte@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 2/2] pvenode task log: don't hardcode 'limit' in CLI
Date: Tue, 31 Aug 2021 16:42:25 +0200	[thread overview]
Message-ID: <20210831144225.2996999-2-d.whyte@proxmox.com> (raw)
In-Reply-To: <20210831144225.2996999-1-d.whyte@proxmox.com>

Removes the hardcoded '--limit' option when setting up the
'pvenode task log' command. This allows a user to control this option
themselves.

Also changes the default limit from 50 to 500, as this is what we use in
the GUI, and should be plenty for the majority of tasks.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
---
 PVE/API2/Tasks.pm  | 4 ++--
 PVE/CLI/pvenode.pm | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Tasks.pm b/PVE/API2/Tasks.pm
index 9cd1e56b..ce87cdac 100644
--- a/PVE/API2/Tasks.pm
+++ b/PVE/API2/Tasks.pm
@@ -347,7 +347,7 @@ __PACKAGE__->register_method({
 	    limit => {
 		type => 'integer',
 		minimum => 0,
-		default => 50,
+		default => 500,
 		optional => 1,
 		description => "The maximum amount of lines that should be printed.",
 	    },
@@ -379,7 +379,7 @@ __PACKAGE__->register_method({
 	my $user = $rpcenv->get_user();
 	my $node = $param->{node};
 	my $start = $param->{start} // 0;
-	my $limit = $param->{limit} // 50;
+	my $limit = $param->{limit} // 500;
 
 	$convert_token_task->($task);
 
diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index acef6c3b..b45735e0 100644
--- a/PVE/CLI/pvenode.pm
+++ b/PVE/CLI/pvenode.pm
@@ -194,8 +194,7 @@ our $cmddef = {
 	    my ($data, $schema, $options) = @_;
 	    PVE::CLIFormatter::print_api_result($data, $schema, undef, $options);
 	}, $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 {
+	log => [ 'PVE::API2::Tasks', 'read_task_log', [ 'upid' ], { node => $nodename }, sub {
 	    my ($data, $resultprops) = @_;
 	    foreach my $line (@$data) {
 		print $line->{t} . "\n";
-- 
2.30.2





  reply	other threads:[~2021-08-31 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 14:42 [pve-devel] [PATCH pve-manager 1/2] Add/fix option descriptions in pvenode api docs Dylan Whyte
2021-08-31 14:42 ` Dylan Whyte [this message]
2021-08-31 15:08   ` [pve-devel] [PATCH pve-manager 2/2] pvenode task log: don't hardcode 'limit' in CLI Thomas Lamprecht
2021-08-31 15:03 ` [pve-devel] applied: [PATCH pve-manager 1/2] Add/fix option descriptions in pvenode api docs Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210831144225.2996999-2-d.whyte@proxmox.com \
    --to=d.whyte@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal