From d6c3313138438c43aa7d2604c799492515a053e1 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Sun, 29 Sep 2013 23:17:32 -0400 Subject: [PATCH] fix for device serial, just use entry with no parent since class could be stack rather than chassis --- Info/Layer3/Nexus.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Info/Layer3/Nexus.pm b/Info/Layer3/Nexus.pm index b8c4c45c..30b3bade 100644 --- a/Info/Layer3/Nexus.pm +++ b/Info/Layer3/Nexus.pm @@ -141,13 +141,11 @@ sub os_ver { sub serial { my $nexus = shift; - my $e_class = $nexus->e_class(); my $e_parent = $nexus->e_parent(); - foreach my $iid ( keys %$e_class ) { - my $class = $e_class->{$iid} || ''; - my $parent = $e_parent->{$iid} || 1; - if ($class =~ /chassis/ && $e_parent == 0) { + foreach my $iid ( keys %$e_parent ) { + my $parent = $e_parent->{$iid}; + if ($parent eq '0') { my $serial = $nexus->e_serial($iid); return $serial->{$iid}; }