Respect version/comm/secname on passed Session obj

This commit is contained in:
Oliver Gorwits
2016-04-26 21:17:35 +01:00
parent 06806f5a6e
commit 72773117e5
2 changed files with 6 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ version 3.32 ()
* Add VMware support * Add VMware support
* Support for propMultiplexor as ifType * Support for propMultiplexor as ifType
* Add device MAC to APC UPS * Add device MAC to APC UPS
* Report APC model for PDU products (#61) * [#61] Report APC model for PDU products
[BUG FIXES] [BUG FIXES]
@@ -19,7 +19,8 @@ version 3.32 ()
* Detect Cisco VG350s as L3 devices instead of APs * Detect Cisco VG350s as L3 devices instead of APs
* fix for 'Use of inherited AUTOLOAD for non-method SNMP::Info::Layer2::HP::agg_ports_ifstack() is deprecated' * fix for 'Use of inherited AUTOLOAD for non-method SNMP::Info::Layer2::HP::agg_ports_ifstack() is deprecated'
* Workaround in IPv6.pm to deal with possibly incorrect IPV6-MIB implementations * Workaround in IPv6.pm to deal with possibly incorrect IPV6-MIB implementations
* AUTOLOAD typo-catcher search for SNMP::Info no longer anchored * [#71] AUTOLOAD typo-catcher search for SNMP::Info no longer anchored
* [#70] Respect version/comm/secname on passed Session obj
version 3.31 (2016-01-22) version 3.31 (2016-01-22)

View File

@@ -1244,9 +1244,9 @@ sub new {
$new_obj->{store} ||= {}; $new_obj->{store} ||= {};
$new_obj->{sess} = $sess; $new_obj->{sess} = $sess;
$new_obj->{args} = \%args; $new_obj->{args} = \%args;
$new_obj->{snmp_ver} = $args{Version} || 2; $new_obj->{snmp_ver} = $sess->{Version} || $args{Version} || 2;
$new_obj->{snmp_comm} = $args{Community} || 'public'; $new_obj->{snmp_comm} = $sess->{Community} || $args{Community} || 'public';
$new_obj->{snmp_user} = $args{SecName} || 'initial'; $new_obj->{snmp_user} = $sess->{SecName} || $args{SecName} || 'initial';
return $auto_specific ? $new_obj->specify() : $new_obj; return $auto_specific ? $new_obj->specify() : $new_obj;
} }