public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 manager] cli: tasks: don't treat warning status as an error status
Date: Fri,  2 Jul 2021 12:35:58 +0200	[thread overview]
Message-ID: <20210702103558.53618-1-f.ebner@proxmox.com> (raw)

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Changes from v1:
    * Drop already applied patches.
    * Drop change to exclude warnings in 'tasks' API call when
      errors=1. One could argue that warnings are not real errors, but
      in PBS, warnings are also included if errors=1, so keep it
      consistent with that.

 PVE/CLI/pvenode.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index acd573f0..acef6c3b 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';
 		}
 	    }
-- 
2.30.2





             reply	other threads:[~2021-07-02 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 10:35 Fabian Ebner [this message]
2021-07-02 10:59 ` [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=20210702103558.53618-1-f.ebner@proxmox.com \
    --to=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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal