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

Dietmar Maurer dietmar at proxmox.com
Wed Jun 20 12:29:53 CEST 2018


applied

> On June 20, 2018 at 11:46 AM René Jochum <r.jochum at proxmox.com> wrote:
> 
> 
> 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
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list