[pve-devel] [PATCH pve-client] Handle errors on tasks correctly with a die,

René Jochum r.jochum at proxmox.com
Wed Jun 20 11:46:55 CEST 2018


so we get the correct exit code on errors.

Signed-off-by: René Jochum <r.jochum at proxmox.com>
---
 PVE/APIClient/Helpers.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm
index 7d855ec..5c2e4cb 100644
--- a/PVE/APIClient/Helpers.pm
+++ b/PVE/APIClient/Helpers.pm
@@ -355,6 +355,10 @@ sub poll_task {
 	sleep(2);
     }
 
+    if ($task_status->{exitstatus} ne "OK") {
+	die $task_status->{exitstatus};
+    }
+
     return $task_status->{exitstatus};
 }
 
-- 
2.11.0




More information about the pve-devel mailing list