2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-28 20:39:40 +00:00

Handle malformed json data more gracefully

This commit is contained in:
Jarrod Johnson 2021-03-08 02:55:58 -05:00
parent 94a4a7e20b
commit 1a7c238b54

View File

@ -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: