pvenode: use 'UNKNOWN' if task status is missing

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2019-01-23 14:56:35 +01:00 committed by Thomas Lamprecht
parent 236f253c9e
commit 99aca71627

View File

@ -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';
}
}