Improve generic Info::Layer3 serial number detection
Serial numbers weren't reported for stackable Layer3::H3C devices, even when not actually stacked. Report serial number not only if the entity has no parent, but also if it has a parent but is of type "chassis". This fixes #232.
This commit is contained in:
4
Changes
4
Changes
@@ -6,6 +6,10 @@ version 3.38 ()
|
|||||||
|
|
||||||
* Layer2::Airespace several newer 802.11 data rates added
|
* Layer2::Airespace several newer 802.11 data rates added
|
||||||
|
|
||||||
|
[BUG FIXES]
|
||||||
|
|
||||||
|
* #232 Improve generic Info::Layer3 serial number detection
|
||||||
|
|
||||||
version 3.37 (2017-07-11)
|
version 3.37 (2017-07-11)
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|||||||
@@ -196,10 +196,13 @@ sub serial {
|
|||||||
|
|
||||||
my $serial1 = $l3->serial1();
|
my $serial1 = $l3->serial1();
|
||||||
my $e_parent = $l3->e_parent() || {};
|
my $e_parent = $l3->e_parent() || {};
|
||||||
|
my $e_class = $l3->e_class() || {};
|
||||||
|
|
||||||
foreach my $iid ( keys %$e_parent ) {
|
foreach my $iid ( keys %$e_parent ) {
|
||||||
my $parent = $e_parent->{$iid};
|
my $parent = $e_parent->{$iid};
|
||||||
if ( $parent eq '0' ) {
|
my $class = $e_class->{$iid} || '';
|
||||||
|
# Only consider serial numbers for entries without a parent, or if they are of type "chassis"
|
||||||
|
if ( $parent eq '0' or $class eq 'chassis') {
|
||||||
my $serial = $l3->e_serial($iid);
|
my $serial = $l3->e_serial($iid);
|
||||||
if ( $serial && $serial->{$iid} ) {
|
if ( $serial && $serial->{$iid} ) {
|
||||||
return $serial->{$iid};
|
return $serial->{$iid};
|
||||||
|
|||||||
Reference in New Issue
Block a user