[pve-devel] [PATCH manager 3/5] vzdump: fix error format for errors coming from storage_info

Fabian Ebner f.ebner at proxmox.com
Mon Dec 21 14:48:18 CET 2020


Errors from storage_info() are newline-terminated, because perl would append
the line number otherwise. Chomp those errors, because sendmail() relies
on the presence of a newline to decide if it's multiple problems or only one.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/VZDump.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 3b864514..d6f9709b 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -498,6 +498,7 @@ sub new {
     if ($opts->{storage}) {
 	my $info = eval { storage_info ($opts->{storage}) };
 	if (my $err = $@) {
+	    chomp($err);
 	    $errors .= "could not get storage information for '$opts->{storage}': $err";
 	} else {
 	    $opts->{dumpdir} = $info->{dumpdir};
-- 
2.20.1






More information about the pve-devel mailing list