From 99aca71627e6fde675b4d12f19ef24ff64ce458e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 23 Jan 2019 14:56:35 +0100 Subject: [PATCH] pvenode: use 'UNKNOWN' if task status is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- PVE/CLI/pvenode.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm index 647fad19..1989e8b3 100644 --- a/PVE/CLI/pvenode.pm +++ b/PVE/CLI/pvenode.pm @@ -165,7 +165,9 @@ our $cmddef = { list => [ 'PVE::API2::Tasks', 'node_tasks', [], { node => $nodename }, sub { my ($data, $schema, $options) = @_; foreach my $task (@$data) { - if ($task->{status} ne 'OK' && $task->{status} ne 'RUNNING') { + if (!defined($task->{status})) { + $task->{status} = 'UNKNOWN'; + } elsif ($task->{status} ne 'OK' && $task->{status} ne 'RUNNING') { $task->{status} = 'ERROR'; } }