1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Handle 'No more variables left in this MIB View ' in snmp_facts (#613)

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
ernst-s 2020-07-21 09:10:26 +02:00 committed by GitHub
parent 7ac467a359
commit d7aabcceed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- snmp_facts - skip ``EndOfMibView`` values (https://github.com/ansible/ansible/issues/49044).

View file

@ -173,6 +173,7 @@ from collections import defaultdict
PYSNMP_IMP_ERR = None
try:
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.proto.rfc1905 import EndOfMibView
has_pysnmp = True
except Exception:
PYSNMP_IMP_ERR = traceback.format_exc()
@ -393,6 +394,8 @@ def main():
for varBinds in varTable:
for oid, val in varBinds:
if isinstance(val, EndOfMibView):
continue
current_oid = oid.prettyPrint()
current_val = val.prettyPrint()
if v.ifIndex in current_oid: