[pve-devel] [PATCH v3 manager 5/5] pvenode: use 'UNKNOWN' if task status is missing

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jan 23 14:56:35 CET 2019


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---

Notes:
    new in v3

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





More information about the pve-devel mailing list