Skip to content

Commit 66bf723

Browse files
author
Lostboi
committed
Merged etingof#146 from etingof snmpsim
1 parent 32bfd42 commit 66bf723

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

snmpsim/grammar/walk.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,13 @@ def _hex_string_filter(value):
143143
match = re.match(r'^([0-9a-fA-F]{2}(\s+[0-9a-fA-F]{2})*)\s+\[', value)
144144
if match:
145145
return [int(y, 16) for y in match.group(1).split(' ')]
146+
elif ' ' in value:
147+
return [int(y, 16) for y in value.split(' ')]
148+
else:
149+
# This could be the format returned by some unknown windows snmpwalk tool:
150+
# .1.3.6.1.2.1.2.2.1.6.1 = HEX-STRING: 00029929AE3C
151+
return [int(value[i:i+2], 16) for i in range(0, len(value), 2)]
146152

147-
return [int(y, 16) for y in value.split(' ')]
148-
149153
@staticmethod
150154
def _gauge_filter(value):
151155
try:

0 commit comments

Comments
 (0)