Skip to content

Commit

Permalink
Fix error only trigerred under win32
Browse files Browse the repository at this point in the history
Fix new SNMP::MibSupport feature for netdiscovery & netinventory under win32
  • Loading branch information
g-bougard committed Nov 24, 2017
1 parent 9338302 commit 067de28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/FusionInventory/Agent/SNMP/MibSupport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use warnings;
# Extracted from SNMPv2-MIB standard
use constant sysORID => '.1.3.6.1.2.1.1.9.1.2';

use English qw(-no_match_vars);
use File::Glob;
use UNIVERSAL::require;

Expand Down Expand Up @@ -33,6 +34,10 @@ sub new {
my ($sub_modules_path) = $INC{module2file(__PACKAGE__)} =~ /(.*)\.pm/;
my %available_mib_support = ();
foreach my $file (File::Glob::bsd_glob("$sub_modules_path/*.pm")) {
if ($OSNAME eq 'MSWin32') {
$file =~ s{\\}{/}g;
$sub_modules_path =~ s{\\}{/}g;
}
next unless $file =~ m{$sub_modules_path/(\S+)\.pm$};

my $module = __PACKAGE__ . "::" . $1;
Expand Down

0 comments on commit 067de28

Please sign in to comment.