Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

End-to-end path simulation fails when path data isn't in snapshot #41

Closed
chipn opened this issue Sep 1, 2021 · 1 comment
Closed

End-to-end path simulation fails when path data isn't in snapshot #41

chipn opened this issue Sep 1, 2021 · 1 comment
Assignees

Comments

@chipn
Copy link
Contributor

chipn commented Sep 1, 2021

If a snapshot doesn't contain data for the requested path, the user will see the following error in chat:

image

This issue occurs when the e2e path data returned is incomplete and doesn't contain a forwarding key:

>>> 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.

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).

@chipn chipn added the type: bug label Sep 1, 2021
@pke11y pke11y self-assigned this Sep 5, 2021
@pke11y
Copy link
Contributor

pke11y commented Sep 13, 2021

Fixed in #43

@chipn chipn closed this as completed Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants