From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B9BF76F9CF for ; Tue, 31 Aug 2021 16:42:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9CF662750A for ; Tue, 31 Aug 2021 16:42:48 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 267FE274A8 for ; Tue, 31 Aug 2021 16:42:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id F28924437F for ; Tue, 31 Aug 2021 16:42:43 +0200 (CEST) From: Dylan Whyte To: pve-devel@lists.proxmox.com Date: Tue, 31 Aug 2021 16:42:25 +0200 Message-Id: <20210831144225.2996999-2-d.whyte@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210831144225.2996999-1-d.whyte@proxmox.com> References: <20210831144225.2996999-1-d.whyte@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.583 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pvenode.pm, tasks.pm] Subject: [pve-devel] [PATCH pve-manager 2/2] pvenode task log: don't hardcode 'limit' in CLI X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2021 14:42:48 -0000 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 --- 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