Skip to content

Commit

Permalink
Merge pull request #65 from RIPE-NCC/TracerouteFixes
Browse files Browse the repository at this point in the history
Traceroute fixes
  • Loading branch information
danielquinn committed Dec 15, 2015
2 parents 67cd045 + 093c057 commit f05f392
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ protocol str One of ``ICMP``, ``TCP``, ``UDP``
hops list A list of :ref:`traceroute-hop` objects
total_hops int The total number of hops
ip_path list A list of dicts containing the IPs at each hop. This is just for convenience as all of these values are accessible via the :ref:`traceroute-hop` and :ref:`traceroute-packet` objects.
last_rtt float The RTT from the last successful hop
last_median_rtt float The median value of all RTTs from the last successful hop
destination_ip_responded bool Set to ``True`` if the last hop was a response from the destination IP
last_hop_responded bool Set to ``True`` if the last hop was a response at all
is_success bool Set to ``True`` if the traceroute finished successfully
last_hop_errors list A list of last hop's errors
======================== ======== ===================================================================================


Expand All @@ -114,6 +116,7 @@ Property Type Explanation
===================== ===== ================================================================
index int The hop number, starting with 1
packets list A list of tracroute :ref:`traceroute-packet` objects
median_rtt float The median value of all RTTs of the hop
===================== ===== ================================================================


Expand Down
6 changes: 5 additions & 1 deletion ripe/atlas/sagan/traceroute.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def set_is_success(self, last_hop):
self.set_last_hop_errors(last_hop)

def set_last_hop_errors(self, last_hop):
"""Sets the last hop's errors.."""
"""Sets the last hop's errors."""
if last_hop.is_error:
self.last_hop_errors.append(last_hop.error_message)
return

for packet in last_hop.packets:
if packet.is_error:
self.last_hop_errors.append(packet.error_message)
Expand Down

0 comments on commit f05f392

Please sign in to comment.