]> git.proxmox.com Git - pve-storage.git/commitdiff
ZFS Pool: improve error output from activate_storage
authorWolfgang Link <w.link@proxmox.com>
Tue, 16 Apr 2019 13:18:22 +0000 (15:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Apr 2019 08:05:04 +0000 (08:05 +0000)
related to #2154 which has some issues on zpool list, but we do not
see the error messages from that step : Buggy "pvesm status" output

PVE/Storage/ZFSPoolPlugin.pm

index 4f16351d5cbc4a7eb3e1eef478af666333cbe803..9ba3999c57e214c093aff8f8f08050006825494d 100644 (file)
@@ -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;
 }