From ca7711b37325fc338fde8efdcdecbecb24b6d7b6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 22 May 2018 09:36:09 -0400 Subject: [PATCH] Fix missing portname in lldp data Root cause was pysnmp returning extraneous leftover data causing calling code to overrite good data. --- confluent_server/confluent/snmputil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/snmputil.py b/confluent_server/confluent/snmputil.py index aa48b93e..ae6c39b6 100644 --- a/confluent_server/confluent/snmputil.py +++ b/confluent_server/confluent/snmputil.py @@ -99,6 +99,10 @@ class Session(object): elif errnum: raise exc.ConfluentException(errnum.prettyPrint()) for ans in answers: + if not obj[0].isPrefixOf(ans[0]): + # PySNMP returns leftovers in a bulk command + # filter out such leftovers + break yield ans except snmperr.WrongValueError: raise exc.TargetEndpointBadCredentials('Invalid SNMPv3 password')