Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: traceroute output parsing in ios #1102

Merged
merged 6 commits into from
Jan 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -3222,8 +3222,12 @@ def traceroute(
stop_index = next_hop_match.start()
# Now you have the start and stop index for each hop
# and you can parse the probes
# Set the hop_variable, and remove spaces between msec for easier matching
hop_string = output[start_index:stop_index].replace(" msec", "msec")
# Set the hop_variable, and remove spaces between msec and [AS 1234] for easier matching
hop_string = re.sub(
r" \[AS [0-9.]+\]",
"",
output[start_index:stop_index].replace(" msec", "msec"),
)
hop_list = hop_string.split()
current_hop = int(hop_list.pop(0))
# Prepare dictionary for each hop (assuming there are 3 probes in each hop)
Expand Down