Skip to content

Commit

Permalink
Fix snmpwalk format parser
Browse files Browse the repository at this point in the history
This change should parse records like this:

.1.3.6.1.4.1.12356.101.14.4.1.1.3.1.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx = BITS: 40 clear(1)

See GitHub issue #87
  • Loading branch information
etingof committed Sep 2, 2019
1 parent a69bc96 commit ca5e7ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snmpsim/grammar/walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def _bitsFilter(value):
# rfc1902.Bits does not really initialize from sequences
# Clean bits values
# .1.3.6.1.2.1.17.6.1.1.1.0 = BITS: 5B 00 00 00 [[...]1 3 4 6 7
match = re.match(r'^([0-9a-fA-F]{2}(\s+[0-9a-fA-F]{2})*)\s+\[', value)
# .1.3.6.1.2.1.17.6.1.1.1.0 = BITS: 5B 00 00 00 clear(1)
match = re.match(r'^([0-9a-fA-F]{2}(\s+[0-9a-fA-F]{2})*)', value)
if match:
return ints2octs([int(y, 16) for y in match.group(1).split(' ')])

Expand Down

0 comments on commit ca5e7ea

Please sign in to comment.