There's also support for ending a task with warnings now, so the logic "status not 'OK' means error" does not work anymore.
Signed-off-by: Fabian Ebner <f.eb...@proxmox.com> --- src/PVE/Tools.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 16ae3d2..6f205df 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1165,6 +1165,14 @@ sub upid_read_status { return "unable to read tail (got $br bytes)"; } +# Check if the status returned by upid_read_status is an error status. +# If the status could not be parsed it's also treated as an error. +sub upid_status_is_error { + my ($status) = @_; + + return !($status eq 'OK' || $status =~ m/^WARNINGS: \d+$/); +} + # useful functions to store comments in config files sub encode_text { my ($text) = @_; -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel