scan_cifs: raise smbclient errors
Silencing error messages can extend the search for an issue while having to advantage. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -17,7 +17,7 @@ use Time::Local qw(timelocal);
|
|||||||
use PVE::Tools qw(run_command file_read_firstline dir_glob_foreach $IPV6RE);
|
use PVE::Tools qw(run_command file_read_firstline dir_glob_foreach $IPV6RE);
|
||||||
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file);
|
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file);
|
||||||
use PVE::DataCenterConfig;
|
use PVE::DataCenterConfig;
|
||||||
use PVE::Exception qw(raise_param_exc);
|
use PVE::Exception qw(raise_param_exc raise);
|
||||||
use PVE::JSONSchema;
|
use PVE::JSONSchema;
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
use PVE::RPCEnvironment;
|
use PVE::RPCEnvironment;
|
||||||
@ -1205,9 +1205,12 @@ sub scan_cifs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $res = {};
|
my $res = {};
|
||||||
|
my $err = '';
|
||||||
run_command($cmd,
|
run_command($cmd,
|
||||||
noerr => 1,
|
noerr => 1,
|
||||||
errfunc => sub { },
|
errfunc => sub {
|
||||||
|
$err .= "$_[0]\n"
|
||||||
|
},
|
||||||
outfunc => sub {
|
outfunc => sub {
|
||||||
my $line = shift;
|
my $line = shift;
|
||||||
if ($line =~ m/(\S+)\s*Disk\s*(\S*)/) {
|
if ($line =~ m/(\S+)\s*Disk\s*(\S*)/) {
|
||||||
@ -1217,6 +1220,7 @@ sub scan_cifs {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
raise($err) if $err;
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user