[pve-devel] [PATCH v2 manager] cli: tasks: don't treat warning status as an error status
Fabian Ebner
f.ebner at proxmox.com
Fri Jul 2 12:35:58 CEST 2021
Signed-off-by: Fabian Ebner <f.ebner at 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
More information about the pve-devel
mailing list