diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index b81e395c4..4fa9c37b5 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -124,7 +124,7 @@ class CableTermination(models.Model): # many-to-one points so we can select the correct FrontPort when we reach the corresponding # one-to-many point. if peer_port.positions > 1: - position_stack.append(termination.rear_port_position) + position_stack.append(termination) return peer_port @@ -135,7 +135,8 @@ class CableTermination(models.Model): if not position_stack: raise CableTraceSplit(termination) - position = position_stack.pop() + front_port = position_stack.pop() + position = front_port.rear_port_position # Validate the position if position not in range(1, termination.positions + 1): diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index 64c4a22d9..df484609a 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -90,7 +90,13 @@ {% elif position_stack %}
-

Multiple possible paths end at this point. No connection established!

+

+ {% with last_position=position_stack|last %} + Trace completed, but there is no Front Port corresponding to + {{ last_position.device }} {{ last_position }}.
+ Therefore no end-to-end connection can be established. + {% endwith %} +

{% else %}