]> git.proxmox.com Git - pve-storage.git/commitdiff
avoid output of zfs get command on volume import
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 1 Oct 2020 08:11:35 +0000 (10:11 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 28 Oct 2020 13:05:49 +0000 (14:05 +0100)
quiet takes care of both the error and success case.
Without this, there are lines like:
myzpool/vm-4352-disk-0@__replicate_4352-7_1601538554__ name myzpool/vm-4352-disk-0@__replicate_4352-7_1601538554__ -
in the log if the dataset exists, and this information is
already present in more readable form.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index 6ac05b429484cf3001c230d1dab4b6d9f3325161..07540b3ecb5b44ea3c2fa6e312e0622fdf678b73 100644 (file)
@@ -731,7 +731,7 @@ sub volume_import {
     my $zfspath = "$scfg->{pool}/$dataset";
     my $suffix = defined($base_snapshot) ? "\@$base_snapshot" : '';
     my $exists = 0 == run_command(['zfs', 'get', '-H', 'name', $zfspath.$suffix],
-                            noerr => 1, errfunc => sub {});
+                                 noerr => 1, quiet => 1);
     if (defined($base_snapshot)) {
        die "base snapshot '$zfspath\@$base_snapshot' doesn't exist\n" if !$exists;
     } elsif ($exists) {