Use the SNMP::Info class attribute rather than re-querying for device_type. SNMP::Info classes that override the layers attribute may not return the same device_type after object instantiation. This also saves a SNMP query.

This commit is contained in:
Eric A. Miller
2014-06-23 20:54:13 -04:00
parent 71b2ab2563
commit e293a1b819

View File

@@ -169,7 +169,7 @@ sub store_device {
$device->model( Encode::decode('UTF-8', $snmp->model) );
$device->serial( Encode::decode('UTF-8', $snmp->serial) );
$device->snmp_class( $snmp->device_type );
$device->snmp_class( $snmp->{'class'} );
$device->last_discover(\'now()');
schema('netdisco')->txn_do(sub {