report: set timeout and PATH env only locally

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-11 14:27:40 +02:00
parent fb925d656a
commit 73cdcc98be

View File

@ -5,9 +5,6 @@ use warnings;
use PVE::Tools;
$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
my $cmd_timeout = 10; # generous timeout
my $init_report_cmds = sub {
# NOTE: always add new sections to the report_order array!
@ -136,6 +133,9 @@ sub generate {
$report .= shift . "\n";
};
local $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
my $cmd_timeout = 10; # generous timeout
my $run_cmd_params = {
outfunc => $record_output,
errfunc => $record_output,