From bf5c9ee2ed2947f5978990521205ca10fb185290 Mon Sep 17 00:00:00 2001 From: Richard Pilsbury Date: Sat, 24 Jun 2017 11:32:54 +0100 Subject: [PATCH] Catch KeyError Exception --- napalm_panos/panos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm_panos/panos.py b/napalm_panos/panos.py index a1446e5..54d5285 100644 --- a/napalm_panos/panos.py +++ b/napalm_panos/panos.py @@ -431,7 +431,7 @@ def get_route_to(self, destination='', protocol=''): routes_table_xml = xmltodict.parse(self.device.xml_root()) routes_table_json = json.dumps(routes_table_xml['response']['result']['entry']) routes_table = json.loads(routes_table_json) - except AttributeError: + except (AttributeError, KeyError): routes_table = [] if isinstance(routes_table, dict):