[pve-devel] [PATCH manager] fix #1389: vzdump: handle storage failure in new()

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon May 22 13:16:48 CEST 2017


otherwise the mail notification is not triggered

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/VZDump.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 988089f..004672d 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -581,7 +581,12 @@ sub new {
     my $errors = '';
 
     if ($opts->{storage}) {
-	my $info = storage_info ($opts->{storage});
+	my $info;
+	eval {
+	    $info = storage_info ($opts->{storage});
+	};
+	$errors .= "could not get storage information for '$opts->{storage}': $@"
+	    if ($@);
 	$opts->{dumpdir} = $info->{dumpdir};
 	$maxfiles = $info->{maxfiles} if !defined($maxfiles) && defined($info->{maxfiles});
     } elsif ($opts->{dumpdir}) {
-- 
2.1.4





More information about the pve-devel mailing list