Skip to content

Commit

Permalink
Merge pull request #5 from cesbit/dev
Browse files Browse the repository at this point in the history
remove recursive param
  • Loading branch information
joente authored Jan 27, 2023
2 parents 6ff141c + a167d11 commit 93b75e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions asyncsnmplib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def get_next_multi(self, oids):
vbs = await self._get_next(oids)
return [(oid, value) for oid, _, value in vbs if oid[:-1] in oids]

async def walk(self, oid, recursive=True):
async def walk(self, oid):
next_oid = oid
prefixlen = len(oid)
rows = []
Expand All @@ -91,7 +91,6 @@ async def walk(self, oid, recursive=True):
(oid_, value)
for oid_, tag, value in vbs
if oid_[:prefixlen] == oid and
(recursive or oid_[-1] == 0) and
value is not None
]
rows.extend(new_rows)
Expand All @@ -116,7 +115,7 @@ def close(self):
class SnmpV1(Snmp):
version = 0

async def walk(self, oid, recursive=True):
async def walk(self, oid):
next_oid = oid
prefixlen = len(oid)
rows = []
Expand All @@ -131,7 +130,7 @@ async def walk(self, oid, recursive=True):
new_rows = [
(oid_, value)
for oid_, tag, value in vbs
if oid_[:prefixlen] == oid and (recursive or oid_[-1] == 0)
if oid_[:prefixlen] == oid
]
rows.extend(new_rows)

Expand Down
2 changes: 1 addition & 1 deletion asyncsnmplib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def snmp_queries(
else:
results = {}
for oid in queries:
result = await cl.walk(oid, False)
result = await cl.walk(oid)
try:
name, parsed_result = on_result_base(oid, result)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion asyncsnmplib/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.7'
__version__ = '0.1.8'

0 comments on commit 93b75e6

Please sign in to comment.