Closed chipn closed 3 years ago
If a snapshot doesn't contain data for the requested path, the user will see the following error in chat:
This issue occurs when the e2e path data returned is incomplete and doesn't contain a forwarding key:
forwarding
>>> response = ipfabric_api.get_path_simulation("10.0.10.5", "10.0.20.7", "1000", "80", "tcp", 'a8aa600d-e2e8-497b-809a-8a3c93fc805f') >>> response {'graph': {'nodes': [{'id': '10.0.10.5', 'hostname': '10.0.10.5', 'devType': 'host'}, {'id': '10.0.20.7', 'hostname': '10.0.20.7', 'devType': 'host'}], 'lookup': {'state': 'ok', 'id': None}, 'edges': [{'tlabel': '', 'inAcl': None, 'source': '10.0.10.5', 'id': '10.0.10.510.0.20.7l3', 'target': '10.0.20.7', 'linkType': 'cef', 'outAcl': None, 'slabel': ''}], 'type': 'e2e'}, 'ad': []}
>>> ipfabric_api.get_parsed_path_simulation("10.0.10.5", "10.0.20.7", "1000", "80", "tcp", "$last") Traceback (most recent call last): File "<console>", line 1, in <module> File "/source/ipfabric/ipfabric.py", line 169, in get_parsed_path_simulation edge_id = node["forwarding"][0]["dstIntList"][0]["id"] KeyError: 'forwarding'
Currently, both get_parsed_path_simulation and get_src_dst_endpoint rely on the forwarding key to exist.
get_parsed_path_simulation
get_src_dst_endpoint
We need to handle the case when this key doesn't exist and/or the # of edges == 1 (meaning the path can't be determined).
Fixed in #43
If a snapshot doesn't contain data for the requested path, the user will see the following error in chat:
This issue occurs when the e2e path data returned is incomplete and doesn't contain a
forwarding
key:Currently, both
get_parsed_path_simulation
andget_src_dst_endpoint
rely on theforwarding
key to exist.We need to handle the case when this key doesn't exist and/or the # of edges == 1 (meaning the path can't be determined).