Skip to content

Commit

Permalink
Fix PDU consistency check in notification originator
Browse files Browse the repository at this point in the history
  • Loading branch information
etingof authored and lextm committed Aug 26, 2024
1 parent 72bf329 commit 9a7a4ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysnmp/hlapi/v1arch/asyncio/ntforg.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _ensureVarBinds(varBinds):
for idx, varBind in enumerate(varBinds[1:]):
if varBind[0] == sysUpTime:
varBinds[0] = varBind
del varBinds[idx]
del varBinds[idx + 1]
break

if len(varBinds) < 2:
Expand All @@ -149,7 +149,7 @@ def _ensureVarBinds(varBinds):
# Search for and reposition snmpTrapOID if it's elsewhere
for idx, varBind in enumerate(varBinds[2:]):
if varBind[0] == snmpTrapOID:
del varBinds[idx]
del varBinds[idx + 2]
if varBinds[1][0] == snmpTrapOID:
varBinds[1] = varBind
else:
Expand Down

0 comments on commit 9a7a4ef

Please sign in to comment.