Skip to content

Commit

Permalink
Catch KeyError Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Pilsbury authored and Richard Pilsbury committed Jun 24, 2017
1 parent 1547ad8 commit bf5c9ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion napalm_panos/panos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit bf5c9ee

Please sign in to comment.