From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Fabian Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager 2/9] api/cli: tasks: don't treat warnings status as an error status
Date: Thu, 24 Jun 2021 09:06:46 +0200 [thread overview]
Message-ID: <f4a27774-9b11-bab4-ea99-2a279f9e2b96@proxmox.com> (raw)
In-Reply-To: <20210512123258.28178-3-f.ebner@proxmox.com>
On 12.05.21 14:32, Fabian Ebner wrote:
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>
> Dependency bump for pve-common is needed.
>
> PVE/API2/Tasks.pm | 5 ++++-
> PVE/CLI/pvenode.pm | 5 ++++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/PVE/API2/Tasks.pm b/PVE/API2/Tasks.pm
> index 8f6ab603..abae8ba3 100644
> --- a/PVE/API2/Tasks.pm
> +++ b/PVE/API2/Tasks.pm
> @@ -142,7 +142,10 @@ __PACKAGE__->register_method({
>
> return 1 if $typefilter && $task->{type} ne $typefilter;
>
> - return 1 if $errors && $task->{status} && $task->{status} eq 'OK';
> + if ($errors && $task->{status} && !PVE::Tools::upid_status_is_error($task->{status})) {
> + return 1;
> + }
> +
> return 1 if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid});
>
> return 1 if $count++ < $start;
Dominik is working on porting-over/implementing the more modern task filtering + UI we did for PBS,
so above hunk will go obsolete anyway so I'm going to skip this one.
Below should still be useful afterwards.
> diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
> index a33fcd93..b05b3e15 100644
> --- a/PVE/CLI/pvenode.pm
> +++ b/PVE/CLI/pvenode.pm
> @@ -181,7 +181,10 @@ our $cmddef = {
> foreach my $task (@$data) {
> if (!defined($task->{status})) {
> $task->{status} = 'UNKNOWN';
> - } elsif ($task->{status} ne 'OK' && $task->{status} ne 'RUNNING') {
> + # RUNNING is set by the API call and needs to be checked explicitly
> + } elsif (PVE::Tools::upid_status_is_error($task->{status}) &&
> + $task->{status} ne 'RUNNING')
> + {
> $task->{status} = 'ERROR';
> }
> }
>
next prev parent reply other threads:[~2021-06-24 7:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 12:32 [pve-devel] [PATCH-SERIES] correctly handle warnings status Fabian Ebner
2021-05-12 12:32 ` [pve-devel] [PATCH common 1/9] tools: add upid_status_is_error function Fabian Ebner
2021-06-17 13:23 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH manager 2/9] api/cli: tasks: don't treat warnings status as an error status Fabian Ebner
2021-06-24 7:06 ` Thomas Lamprecht [this message]
2021-05-12 12:32 ` [pve-devel] [PATCH manager 3/9] nodes: startall: correctly handle warning status for delayed task Fabian Ebner
2021-06-24 7:04 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH manager 4/9] cli: pveam: remove unused private sub Fabian Ebner
2021-06-24 7:04 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH manager 5/9] cli tools: correctly handle warnings status Fabian Ebner
2021-06-24 7:04 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH storage 6/9] api: content: correctly handle warnings status for delayed task Fabian Ebner
2021-06-23 20:22 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH container 7/9] pct: correctly handle warnings task status Fabian Ebner
2021-06-23 20:17 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH qemu-server 8/9] cli tools: " Fabian Ebner
2021-06-23 10:53 ` [pve-devel] applied: " Thomas Lamprecht
2021-05-12 12:32 ` [pve-devel] [PATCH qemu-server 9/9] api: update vm: correctly handle warnings status for delayed task Fabian Ebner
2021-06-23 10:53 ` [pve-devel] applied: " 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=f4a27774-9b11-bab4-ea99-2a279f9e2b96@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=f.ebner@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