#374 undefined error from H3C class

This commit is contained in:
Oliver Gorwits
2021-10-07 11:41:38 +01:00
parent a0cd7c57e2
commit bce84023ca

View File

@@ -84,14 +84,18 @@ sub vendor {
sub model { sub model {
my $h3c = shift; my $h3c = shift;
my $id = $h3c->id() || '';
my $descr = $h3c->description() || '';
my $entclass = $h3c->entPhysicalClass(2) || {};
my $entity = $entclass->{2} || '';
my $entname = $h3c->entPhysicalName(2) || {};
my $descr = $h3c->description();
if ($descr =~ /^.*\n(.*)\n/) { if ($descr =~ /^.*\n(.*)\n/) {
return $1; return $1;
} elsif ($h3c->entPhysicalClass(2)->{2} =~ /^(3|chassis)$/) { } elsif ($entity =~ /^(3|chassis)$/) {
return $h3c->entPhysicalName(2)->{2}; return $entname->{2};
} else { } else {
my $id = $h3c->id();
return &SNMP::translateObj($id) || $id; return &SNMP::translateObj($id) || $id;
} }
} }