Anonymous | Login | 2024-08-24 22:16 EDT | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||
0000897 | PacketFence | error-handling | public | 2010-01-22 09:54 | 2015-02-13 15:35 | |||
Reporter | obilodeau | |||||||
Assigned To | ||||||||
Priority | normal | Severity | minor | Reproducibility | sometimes | |||
Status | closed | Resolution | open | |||||
Platform | OS | OS Version | ||||||
Product Version | ||||||||
Target Version | Fixed in Version | |||||||
Summary | 0000897: improved SNMP validation | |||||||
Description | There are a lot of places in the code with stuff like that: return ( defined($result) && exists( $result->{"$OID_vmVlan.$ifIndex"}) && ( $result->{"$OID_vmVlan.$ifIndex"} ne 'noSuchInstance' ) ) We should do validation of these type of cases. Since validation will be similar, I think we would need an error wrapper in SNMP.pm and use that to validate SNMP's answers. Logger would then need to complain about the caller to the error handler and not the error wrapper itself (to know what sub in what module exactly caused the problem). I know this is doable in log4perl. | |||||||
Tags | No tags attached. | |||||||
fixed in git revision | ||||||||
fixed in mtn revision | ||||||||
Attached Files | ||||||||
![]() |
|
(0001465) obilodeau (reporter) 2010-02-09 11:42 |
Just did one isolated case that I could test. I added noSuchObject to the below test in isLearntTrapsEnabled sub: return ( exists( $result->{"$OID_cmnMacAddrLearntEnable.$ifIndex"} ) && ( $result->{"$OID_cmnMacAddrLearntEnable.$ifIndex"} ne 'noSuchInstance' ) && ( $result->{"$OID_cmnMacAddrLearntEnable.$ifIndex"} ne 'noSuchObject' ) && ( $result->{"$OID_cmnMacAddrLearntEnable.$ifIndex"} == 1 ) ); committed in branch 1.9 with revno: 951bcc89a66e3caf1e7d0381ed62912111bb69d4 |
(0001948) obilodeau (reporter) 2011-03-18 10:26 |
here's a good way to do it # if $result is defined, it works we can return $TRUE return $TRUE if (defined($result)); # otherwise report failure $logger->warn("setting VLAN failed with " . $this->{_sessionWrite}->error()); return; } |
(0003760) lmunro (administrator) 2015-02-13 15:35 |
No longer relevant. |
![]() |
|||
Date Modified | Username | Field | Change |
2010-01-22 09:54 | obilodeau | New Issue | |
2010-01-22 09:55 | obilodeau | Status | new => assigned |
2010-01-22 09:55 | obilodeau | Assigned To | => obilodeau |
2010-02-09 11:42 | obilodeau | Note Added: 0001465 | |
2010-04-15 17:43 | obilodeau | Project | PacketFence 1.9 => PacketFence |
2011-01-18 11:43 | obilodeau | Target Version | => trunk |
2011-03-18 10:26 | obilodeau | Note Added: 0001948 | |
2012-10-19 14:29 | fgaudreault | Assigned To | obilodeau => |
2012-10-19 14:29 | fgaudreault | Target Version | devel => general |
2015-02-13 15:35 | lmunro | Note Added: 0003760 | |
2015-02-13 15:35 | lmunro | Status | assigned => closed |
Copyright © 2000 - 2012 MantisBT Group |