Skip to content

Commit

Permalink
add default value for vmvlan
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed Dec 3, 2013
1 parent 91e56ee commit 4fab178
Show file tree
Hide file tree
Showing 2 changed files with 3,397 additions and 21 deletions.
42 changes: 21 additions & 21 deletions lib/FusionInventory/Agent/Tools/Hardware.pm
Expand Up @@ -970,28 +970,28 @@ sub _setNetworkingProperties {
my $vlans = $snmp->walk($model->{oids}->{vtpVlanName});

# Detect VLAN
if ($model->{oids}->{vmvlan}) {
my $results = $snmp->walk($model->{oids}->{vmvlan});
# each result matches either of the following schemes:
# $prefix.$i.$j = $value, with $j as port id, and $value as vlan id
# $prefix.$i = $value, with $i as port id, and $value as vlan id
foreach my $suffix (sort keys %{$results}) {
my $port_id = _getElement($suffix, -1);
my $vlan_id = $results->{$suffix};
my $name = $vlans->{$vlan_id};

# safety check
if (!$ports->{$port_id}) {
$logger->error("non-existing port $port_id, check vmvlan mapping");
last;
}
push
@{$ports->{$port_id}->{VLANS}->{VLAN}},
{
NUMBER => $vlan_id,
NAME => $name
};
my $results = $snmp->walk(
$model->{oids}->{vmvlan} || '.1.3.6.1.4.1.9.9.68.1.2.2.1.2'
);
# each result matches either of the following schemes:
# $prefix.$i.$j = $value, with $j as port id, and $value as vlan id
# $prefix.$i = $value, with $i as port id, and $value as vlan id
foreach my $suffix (sort keys %{$results}) {
my $port_id = _getElement($suffix, -1);
my $vlan_id = $results->{$suffix};
my $name = $vlans->{$vlan_id};

# safety check
if (!$ports->{$port_id}) {
$logger->error("non-existing port $port_id, check vmvlan mapping");
last;
}
push
@{$ports->{$port_id}->{VLANS}->{VLAN}},
{
NUMBER => $vlan_id,
NAME => $name
};
}

_setTrunkPorts(
Expand Down

0 comments on commit 4fab178

Please sign in to comment.