From 2a87c32800442e5362b76f7327c214d9ca297de7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 8 Mar 2021 02:55:58 -0500 Subject: [PATCH] Handle malformed json data more gracefully --- confluent_server/confluent/discovery/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 461ce8bb..5ff5240c 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -811,7 +811,11 @@ def get_smm_neighbor_fingerprints(smmaddr, cv): if ':' in smmaddr: smmaddr = '[{0}]'.format(smmaddr) wc = webclient.SecureHTTPConnection(smmaddr, verifycallback=cv) - neighs = wc.grab_json_response('/scripts/neighdata.json') + try: + neighs = wc.grab_json_response('/scripts/neighdata.json') + except Exception: + log.log({'error': 'Failure getting LLDP information from {}'.format(smmaddr)}) + return if not neighs: return for neigh in neighs: