summaryrefslogtreecommitdiff
path: root/pysnmp/entity/rfc3413/ntfrcv.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-02-26 08:56:24 +0100
committerGitHub <noreply@github.com>2019-02-26 08:56:24 +0100
commit3f2f132a9fdf7a48ec6131d5498145dded3cfcad (patch)
tree63e6170b35f6b392bf2e3d3feb6996b886e4d36f /pysnmp/entity/rfc3413/ntfrcv.py
parent2ad26f8bfef0e39b3789d9e6d4fcbf76820c9867 (diff)
downloadpysnmp-git-3f2f132a9fdf7a48ec6131d5498145dded3cfcad.tar.gz
PEP-8 long lines and dunders (#245)
This patch massively reformats the whole codebase mainly wrapping long lines and eliminating dundered private attributes.
Diffstat (limited to 'pysnmp/entity/rfc3413/ntfrcv.py')
-rw-r--r--pysnmp/entity/rfc3413/ntfrcv.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pysnmp/entity/rfc3413/ntfrcv.py b/pysnmp/entity/rfc3413/ntfrcv.py
index a4754be2..53cc7ac3 100644
--- a/pysnmp/entity/rfc3413/ntfrcv.py
+++ b/pysnmp/entity/rfc3413/ntfrcv.py
@@ -31,7 +31,8 @@ class NotificationReceiver(object):
def storeSnmpTrapCommunity(snmpEngine, execpoint, variables, cbCtx):
self.__snmpTrapCommunity = variables.get('communityName', '')
- snmpEngine.observer.registerObserver(storeSnmpTrapCommunity, 'rfc2576.processIncomingMsg')
+ snmpEngine.observer.registerObserver(
+ storeSnmpTrapCommunity, 'rfc2576.processIncomingMsg')
def close(self, snmpEngine):
snmpEngine.msgAndPduDsp.unregisterContextEngineId(
@@ -48,6 +49,7 @@ class NotificationReceiver(object):
if messageProcessingModel == 0:
origPdu = PDU
PDU = rfc2576.v1ToV2(PDU, snmpTrapCommunity=self.__snmpTrapCommunity)
+
else:
origPdu = None
@@ -89,12 +91,17 @@ class NotificationReceiver(object):
except error.StatusInformation as exc:
debug.logger & debug.FLAG_APP and debug.logger(
'processPdu: stateReference %s, statusInformation %s' % (stateReference, exc))
- snmpSilentDrops, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB',
- 'snmpSilentDrops')
+
+ mibBuilder = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder
+
+ snmpSilentDrops, = mibBuilder.importSymbols(
+ '__SNMPv2-MIB', 'snmpSilentDrops')
+
snmpSilentDrops.syntax += 1
elif PDU.tagSet in rfc3411.UNCONFIRMED_CLASS_PDUS:
pass
+
else:
raise error.ProtocolError('Unexpected PDU class %s' % PDU.tagSet)