Skip to content

Commit

Permalink
style: make t/07whitespaces.t test happy
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Dec 16, 2019
1 parent 95cbbb2 commit 3c40da2
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 91 deletions.
176 changes: 88 additions & 88 deletions lib/FusionInventory/Agent/SNMP/MibSupport/FreeBSD.pm
@@ -1,88 +1,88 @@
package FusionInventory::Agent::SNMP::MibSupport::FreeBSD;

use strict;
use warnings;

use parent 'FusionInventory::Agent::SNMP::MibSupportTemplate';

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::SNMP;

# https://documentation.stormshield.eu/SNS/v3/fr/Content/User_Configuration_Manual_SNS_v3/SNMP_Agent/MIBS_and_traps_SNMP.htm
use constant freebsd => '.1.3.6.1.4.1.8072.3.2.8';
use constant stormshield => '.1.3.6.1.4.1.11256' ;
use constant stormshield_model => stormshield.'.1.0.1.0' ;
use constant stormshield_fw_pri => stormshield.'.1.0.2.0' ;
use constant stormshield_serial => stormshield.'.1.0.3.0' ;
use constant stormshield_name => stormshield.'.1.0.4.0' ;

our $mibSupport = [
{
name => "FreeBSD",
sysobjectid => getRegexpOidMatch(freebsd)
}
];

sub _is_stormshield {
my ($self) = @_;

if (!defined $self->{STORMSHIELD}) {
$self->{STORMSHIELD} = $self->get(stormshield_model) ? 1 : 0;
}

return $self->{STORMSHIELD};
}

sub getSerial {
my ($self) = @_;

return $self->get(stormshield_serial) if $self->_is_stormshield();
}


sub getFirmware {
my ($self) = @_;

return $self->get(stormshield_fw_pri) if $self->_is_stormshield();
}

sub getType {
my ($self) = @_;

return 'NETWORKING' if $self->_is_stormshield();
}

sub getModel {
my ($self) = @_;
return $self->get(stormshield_model) if $self->_is_stormshield();
}

sub getManufacturer {
my ($self) = @_;

return 'StormShield' if $self->_is_stormshield();
}

sub run {
my ($self) = @_;

if ($self->_is_stormshield()) {
my $device = $self->device or return;

my $name = $self->get(stormshield_name);
$device->{INFO}->{NAME} = $name if $name;
}
}

1;

__END__
=head1 NAME
FusionInventory::Agent::SNMP::MibSupport::FreeBSD - Inventory module for FreeBSD
=head1 DESCRIPTION
The module enhances FreeBSD devices support.
package FusionInventory::Agent::SNMP::MibSupport::FreeBSD;

use strict;
use warnings;

use parent 'FusionInventory::Agent::SNMP::MibSupportTemplate';

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::SNMP;

# https://documentation.stormshield.eu/SNS/v3/fr/Content/User_Configuration_Manual_SNS_v3/SNMP_Agent/MIBS_and_traps_SNMP.htm
use constant freebsd => '.1.3.6.1.4.1.8072.3.2.8';
use constant stormshield => '.1.3.6.1.4.1.11256' ;
use constant stormshield_model => stormshield.'.1.0.1.0' ;
use constant stormshield_fw_pri => stormshield.'.1.0.2.0' ;
use constant stormshield_serial => stormshield.'.1.0.3.0' ;
use constant stormshield_name => stormshield.'.1.0.4.0' ;

our $mibSupport = [
{
name => "FreeBSD",
sysobjectid => getRegexpOidMatch(freebsd)
}
];

sub _is_stormshield {
my ($self) = @_;

if (!defined $self->{STORMSHIELD}) {
$self->{STORMSHIELD} = $self->get(stormshield_model) ? 1 : 0;
}

return $self->{STORMSHIELD};
}

sub getSerial {
my ($self) = @_;

return $self->get(stormshield_serial) if $self->_is_stormshield();
}


sub getFirmware {
my ($self) = @_;

return $self->get(stormshield_fw_pri) if $self->_is_stormshield();
}

sub getType {
my ($self) = @_;

return 'NETWORKING' if $self->_is_stormshield();
}

sub getModel {
my ($self) = @_;

return $self->get(stormshield_model) if $self->_is_stormshield();
}

sub getManufacturer {
my ($self) = @_;

return 'StormShield' if $self->_is_stormshield();
}

sub run {
my ($self) = @_;

if ($self->_is_stormshield()) {
my $device = $self->device or return;

my $name = $self->get(stormshield_name);
$device->{INFO}->{NAME} = $name if $name;
}
}

1;

__END__
=head1 NAME
FusionInventory::Agent::SNMP::MibSupport::FreeBSD - Inventory module for FreeBSD
=head1 DESCRIPTION
The module enhances FreeBSD devices support.
2 changes: 1 addition & 1 deletion lib/FusionInventory/Agent/Task/Inventory/Win32/License.pm
Expand Up @@ -95,7 +95,7 @@ sub _scanWmiSoftwareLicensingProducts {
if $seenProducts->{$uiidLC}->{'FULLNAME'};
$wmiLicence->{'TRIAL'} = $seenProducts->{$uiidLC}->{'TRIAL'}
if $seenProducts->{$uiidLC}->{'TRIAL'};

my $uiidToDelete = $uiidLC;
if ($seenProducts->{$uiidLC}->{PRODUCTCODE}) {
# Change key Target
Expand Down
2 changes: 1 addition & 1 deletion lib/FusionInventory/Agent/Tools/Hardware.pm
Expand Up @@ -1465,7 +1465,7 @@ sub _getVlans {
next;
}

# Untagged VLAN
# Untagged VLAN
my $bUntagged = unpack("B*", hex2char($UntaggedPorts));
my @bUntagged = split(//,$bUntagged);
next unless @bUntagged;
Expand Down
2 changes: 1 addition & 1 deletion lib/FusionInventory/Agent/Tools/Win32/NetAdapter.pm
Expand Up @@ -117,7 +117,7 @@ sub _getPciid {

sub _getObjectIndex {
my ($self) = @_;

return defined($self->{InterfaceIndex}) ? $self->{InterfaceIndex} : $self->{Index};
}

Expand Down

0 comments on commit 3c40da2

Please sign in to comment.