diff options
author | elie <elie> | 2007-08-11 08:01:36 +0000 |
---|---|---|
committer | elie <elie> | 2007-08-11 08:01:36 +0000 |
commit | 068cb319f9bfaf45f74ae863bd9ac4bc8ca1ba2c (patch) | |
tree | 3c29f1927cec2db1c241ce63218a63565cd4d9a0 | |
parent | bf82efde14b3caca7dadb4d16905e6a1f0ccaba2 (diff) | |
download | pysnmp-068cb319f9bfaf45f74ae863bd9ac4bc8ca1ba2c.tar.gz |
fix to SET CommandResponder according to RFC1905 4.2.5
-rw-r--r-- | pysnmp/entity/rfc3413/cmdrsp.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pysnmp/entity/rfc3413/cmdrsp.py b/pysnmp/entity/rfc3413/cmdrsp.py index 3b41bf7..0a96c80 100644 --- a/pysnmp/entity/rfc3413/cmdrsp.py +++ b/pysnmp/entity/rfc3413/cmdrsp.py @@ -181,6 +181,7 @@ class CommandResponderBase: # Map ACM errors onto SMI ones except error.StatusInformation, statusInformation: errorIndication = statusInformation['errorIndication'] + # 3.2.5... if errorIndication == 'noSuchView' or \ errorIndication == 'noAccessEntry' or \ errorIndication == 'noGroupName': @@ -276,7 +277,12 @@ class SetCommandResponder(CommandResponderBase): self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx) ): # rfc1905: 4.2.5.1-13 - return 0, 0, contextMibInstrumCtl.writeVars( - v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx) - ) - + try: + return 0, 0, contextMibInstrumCtl.writeVars( + v2c.apiPDU.getVarBinds(PDU), (acFun, acCtx) + ) + except ( pysnmp.smi.error.NoSuchObjectError, + pysnmp.smi.error.NoSuchInstanceError ), errorIndication: + e = pysnmp.smi.error.NotWritableError() + e.update(errorIndication) + raise e |