ZFS Pool: improve error output from activate_storage

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
This commit is contained in:
Wolfgang Link
2019-04-16 15:18:22 +02:00
committed by Thomas Lamprecht
parent 4af7713268
commit dc18abe07b

View 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;
}