diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index c4a159126..34ba0c47d 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -77,7 +77,7 @@ class CableTraceMixin(object): # Initialize the path array path = [] - for near_end, cable, far_end in obj.trace(follow_circuits=True): + for near_end, cable, far_end in obj.trace(): # Serialize each object serializer_a = get_serializer_for_model(near_end, prefix='Nested') diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index ce1fa26ec..42f3867b1 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -89,7 +89,7 @@ class CableTermination(models.Model): class Meta: abstract = True - def trace(self, follow_circuits=False): + def trace(self): """ Return a list representing a complete cable path, with each individual segment represented as a three-tuple: [ @@ -102,7 +102,7 @@ class CableTermination(models.Model): path = [] position_stack = [] - def get_peer_port(termination, follow_circuits=False): + def get_peer_port(termination): from circuits.models import CircuitTermination # Map a front port to its corresponding rear port @@ -135,7 +135,7 @@ class CableTermination(models.Model): return None # Follow a circuit to its other termination - elif isinstance(termination, CircuitTermination) and follow_circuits: + elif isinstance(termination, CircuitTermination): peer_termination = termination.get_peer_termination() if peer_termination is None: return None @@ -169,7 +169,7 @@ class CableTermination(models.Model): )) # Get the peer port of the far end termination - endpoint = get_peer_port(far_end, follow_circuits) + endpoint = get_peer_port(far_end) if endpoint is None: return path diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 619e4b5b7..dc4fda7c3 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -2019,7 +2019,7 @@ class CableTraceView(PermissionRequiredMixin, View): def get(self, request, model, pk): obj = get_object_or_404(model, pk=pk) - trace = obj.trace(follow_circuits=True) + trace = obj.trace() total_length = sum([entry[1]._abs_length for entry in trace if entry[1] and entry[1]._abs_length]) return render(request, 'dcim/cable_trace.html', {