Skip Menu |

This queue is for tickets about the SNMP-Info CPAN distribution.

Report information
The Basics
Id: 108611
Status: resolved
Priority: 0/
Queue: SNMP-Info

People
Owner: EMILLER [...] cpan.org
Requestors: abraxxa [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.29
Fixed in: (no value)



Subject: _raw methods not implemented for all subclasses
For example in SNMP::Info::Layer3::F5 i_type is overridden but i_type_raw isn't defined. I'd suggest to test all subclasses for interface conformance or use e.g. Role::Tiny to ensure that.
On Mon Nov 09 07:56:33 2015, ABRAXXA wrote: Show quoted text
> For example in SNMP::Info::Layer3::F5 i_type is overridden but > i_type_raw isn't defined. > I'd suggest to test all subclasses for interface conformance or use > e.g. Role::Tiny to ensure that.
A _raw suffix returns data ignoring any munge routines. The is no munge routine for i_type, so i_type_raw will not return anything different than i_type. See http://search.cpan.org/~oliver/SNMP-Info-3.29/Info.pm#AUTOLOAD
Am Di 10. Nov 2015, 22:08:22, EMILLER schrieb: Show quoted text
> On Mon Nov 09 07:56:33 2015, ABRAXXA wrote:
> > For example in SNMP::Info::Layer3::F5 i_type is overridden but > > i_type_raw isn't defined. > > I'd suggest to test all subclasses for interface conformance or use > > e.g. Role::Tiny to ensure that.
> > A _raw suffix returns data ignoring any munge routines. The is no > munge routine for i_type, so i_type_raw will not return anything > different than i_type. > > See http://search.cpan.org/~oliver/SNMP-Info-3.29/Info.pm#AUTOLOAD
The problem we have with that is that it returns different values than other classes (strings vs. numbers) and so breaks our usage of it. I'd suggest that model specific classes always override the _raw methods and the regular ones just return the munged values as syntactic sugar.
Hi, Sorry, I don't understand what you're suggesting. The _raw suffix is basically a hint to return data without munging. i_type is an enumerated string, so the raw data will be an integer, and the munged data will be the string types which map to them, from the MIB. All implementations of i_type in SNMP::Info ought to work like this. Or have I missed the point? Perhaps you can give a concrete example? regards, oliver. On Fri Jan 01 09:27:51 2016, ABRAXXA wrote: Show quoted text
> Am Di 10. Nov 2015, 22:08:22, EMILLER schrieb:
> > On Mon Nov 09 07:56:33 2015, ABRAXXA wrote:
> > > For example in SNMP::Info::Layer3::F5 i_type is overridden but > > > i_type_raw isn't defined. > > > I'd suggest to test all subclasses for interface conformance or use > > > e.g. Role::Tiny to ensure that.
> > > > A _raw suffix returns data ignoring any munge routines. The is no > > munge routine for i_type, so i_type_raw will not return anything > > different than i_type. > > > > See http://search.cpan.org/~oliver/SNMP-Info-3.29/Info.pm#AUTOLOAD
> > > The problem we have with that is that it returns different values than > other classes (strings vs. numbers) and so breaks our usage of it. > I'd suggest that model specific classes always override the _raw > methods and the regular ones just return the munged values as > syntactic sugar.
-- regards, oliver.
Hi Oliver, yes, like I initially wrote SNMP::Info::Layer3::F5 defines sub i_type but not sub i_type_raw which leads to i_type_raw not returning the raw values.
Hello again, OK I think I see the misunderstanding here. Because we load the MIB for F5, net-snmp will automatically translate enum values from their integer to the string representation (such as "ethernetCsmacd"). Additionally, SNMP::Info can be implemented with a munge routine to further manipulate the values, but that's not done in this case. The _raw suffix to any method is a hint to avoid this second munge. There is no similar way to avoid the MIB translation of the enum. So is that what you're seeing? If not, please can you give some examples of how the output differs from what you expect to see, as I cannot reproduce it here. regards, oliver. On Sun May 15 08:13:50 2016, ABRAXXA wrote: Show quoted text
> Hi Oliver, > yes, like I initially wrote SNMP::Info::Layer3::F5 defines sub i_type > but not sub i_type_raw which leads to i_type_raw not returning the raw > values.
-- regards, oliver.
Closed and moved to Github: https://github.com/netdisco/snmp-info/issues/211 -- regards, oliver.