summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2012-04-06 11:35:38 +0000
committerelie <elie>2012-04-06 11:35:38 +0000
commit75c1eca679e26d3c8d6d980429ee86451fd76249 (patch)
treedea3a94fa5d9b59394f9570689cb9799badfc856
parentcbf539243ee5c85655cf77be4189f973b9c0512b (diff)
downloadpysnmp-75c1eca679e26d3c8d6d980429ee86451fd76249.tar.gz
proper support for ignoreNonIncreasingOIDs option
-rw-r--r--CHANGES2
-rw-r--r--pysnmp/entity/rfc3413/oneliner/cmdgen.py16
2 files changed, 10 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index a6303a0..65fddf9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -26,6 +26,8 @@ Revision 4.2.2
- When running on Python3, SMI will re-raise exceptions with the original
traceback for easier diagnostics.
- Out of PYTHONPATH MIB paths now supported.
+- Fix to oneliner GETNEXT/GETBULK implementation to properly support
+ ignoreNonIncreasingOIDs option.
- Fix to setEndOfMibError()/setNoSuchInstanceError() at v1 PDU not to
loose errorIndex.
- Fix to api.v2c.getVarBindTable() to ignore possible non-rectangular GETBULK
diff --git a/pysnmp/entity/rfc3413/oneliner/cmdgen.py b/pysnmp/entity/rfc3413/oneliner/cmdgen.py
index 07c5985..60f0df5 100644
--- a/pysnmp/entity/rfc3413/oneliner/cmdgen.py
+++ b/pysnmp/entity/rfc3413/oneliner/cmdgen.py
@@ -410,10 +410,10 @@ class CommandGenerator:
def __cbFun(sendRequestHandle, errorIndication,
errorStatus, errorIndex, varBindTable, cbCtx):
(self, varBindHead, varBindTotalTable, appReturn) = cbCtx
- if errorStatus or \
- errorIndication and not self.ignoreNonIncreasingOid or \
- errorIndication and self.ignoreNonIncreasingOid and \
- not isinstance(errorIndication, errind.OidNotIncreasing):
+ if self.ignoreNonIncreasingOid and errorIndication and \
+ isinstance(errorIndication, errind.OidNotIncreasing):
+ errorIndication = None
+ if errorStatus or errorIndication:
appReturn['errorIndication'] = errorIndication
if errorStatus == 2:
# Hide SNMPv1 noSuchName error which leaks in here
@@ -482,10 +482,10 @@ class CommandGenerator:
def __cbFun(sendRequestHandle, errorIndication,
errorStatus, errorIndex, varBindTable, cbCtx):
(self, varBindHead, varBindTotalTable, appReturn) = cbCtx
- if errorStatus or \
- errorIndication and not self.ignoreNonIncreasingOid or \
- errorIndication and self.ignoreNonIncreasingOid and \
- not isinstance(errorIndication, errind.OidNotIncreasing):
+ if self.ignoreNonIncreasingOid and errorIndication and \
+ isinstance(errorIndication, errind.OidNotIncreasing):
+ errorIndication = None
+ if errorStatus or errorIndication:
appReturn['errorIndication'] = errorIndication
appReturn['errorStatus'] = errorStatus
appReturn['errorIndex'] = errorIndex