Handle errors on tasks correctly with a die,

so we get the correct exit code on errors.

Signed-off-by: René Jochum <r.jochum@proxmox.com>
This commit is contained in:
René Jochum 2018-06-20 11:46:55 +02:00 committed by Dietmar Maurer
parent 969b8624f3
commit 20e7131b2d

View File

@ -355,6 +355,10 @@ sub poll_task {
sleep(2);
}
if ($task_status->{exitstatus} ne "OK") {
die $task_status->{exitstatus};
}
return $task_status->{exitstatus};
}