From 4ade67947ff69078c5772a4300eba10f59689569 Mon Sep 17 00:00:00 2001 From: Benjamin Collet Date: Thu, 6 Aug 2020 10:14:22 +0200 Subject: [PATCH] Check for inconsistency in Observium model --- client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.py b/client.py index aa639fa..48fecbd 100755 --- a/client.py +++ b/client.py @@ -81,7 +81,10 @@ def search_ports(args): for port in data['ports'].values(): if port['disabled'] == "1": continue if port['deleted'] == "1": continue - device = devices[port['device_id']] + if port['device_id'] in devices: + device = devices[port['device_id']] + else: + continue if device['disabled'] == "1": continue if args.short: