From e6b701e80944d4fe65b5713739a3ea467ecc3b5e Mon Sep 17 00:00:00 2001 From: albarytu Date: Wed, 27 Jan 2016 12:09:04 +0100 Subject: [PATCH] New version of my previous patch proposal Fixes incorrect behaviour when navigating a long list of different-length oids from snmpwalk, making oid and endoid to be of different length --- pyagentx/network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyagentx/network.py b/pyagentx/network.py index 9711398..9074649 100644 --- a/pyagentx/network.py +++ b/pyagentx/network.py @@ -117,8 +117,10 @@ def _get_next_oid(self, oid, endoid): for i in range(len(tlist)): try: sok = int(slist[i]) <= int(tlist[i]) + if not sok: + break eok = int(elist[i]) >= int(tlist[i]) - if not ( sok and eok ): + if not eok: break except IndexError: pass