summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--pysnmp/entity/rfc3413/cmdgen.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 4c08d3e..d7ed1bd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -40,6 +40,8 @@ Revision 4.2.6rc0
facility.
- MIB instrumentation example improved to cover table index building facility.
- Handle the case of null writer at Debug printer.
+- Do not cache snmpEngineId & snmpAdminString at CommandGenerator to let it
+ be reused with many different snmpEngines.
- Multiple fixes to verify pyasn1 decoder.decode() return to withstand
broken SNMP messages or its components.
- Fix to rfc1902.Bits type to make it accepting hex and binary initializers,
diff --git a/pysnmp/entity/rfc3413/cmdgen.py b/pysnmp/entity/rfc3413/cmdgen.py
index b693b94..1cda2f2 100644
--- a/pysnmp/entity/rfc3413/cmdgen.py
+++ b/pysnmp/entity/rfc3413/cmdgen.py
@@ -35,7 +35,6 @@ class CommandGeneratorBase:
_null = univ.Null('')
def __init__(self):
self.__pendingReqs = {}
- self.__SnmpEngineID, self.__SnmpAdminString = None, None
def processResponsePdu(
self,
@@ -191,13 +190,12 @@ class CommandGeneratorBase:
# Convert timeout in seconds into timeout in timer ticks
timeoutInTicks = float(timeout)/100/snmpEngine.transportDispatcher.getTimerResolution()
- if not self.__SnmpEngineID or not self.__SnmpAdminString:
- self.__SnmpEngineID, self.__SnmpAdminString = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpEngineID', 'SnmpAdminString')
+ SnmpEngineID, SnmpAdminString = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpEngineID', 'SnmpAdminString')
# Cast possible strings into bytes
if contextEngineId:
- contextEngineId = self.__SnmpEngineID(contextEngineId)
- contextName = self.__SnmpAdminString(contextName)
+ contextEngineId = SnmpEngineID(contextEngineId)
+ contextName = SnmpAdminString(contextName)
origPDU = reqPDU