[pve-devel] [PATCH storage] fix #2154: Buggy "pvesm status" output

Wolfgang Link w.link at proxmox.com
Tue Apr 16 15:18:22 CEST 2019


Improve error output.
---
 PVE/Storage/ZFSPoolPlugin.pm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 4f16351..9ba3999 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -528,13 +528,16 @@ sub activate_storage {
     eval {
 	$res = $class->zfs_request($scfg, undef, 'zpool_list', @param);
     };
-
-    if ($@ || !defined($res) || $res !~ $pool) {
+    my $err = $@;
+    if ($err || !defined($res) || $res !~ $pool) {
 	eval {
 	    @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', "$pool");
 	    $class->zfs_request($scfg, undef, 'zpool_import', @param);
 	};
-	die "could not activate storage '$storeid', $@\n" if $@;
+	if ($@) {
+	    warn "$err\n";
+	    die "could not activate storage '$storeid', $@\n";
+	}
     }
     return 1;
 }
-- 
2.11.0





More information about the pve-devel mailing list