mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Remove unused follow_circuits arg for cable tracing
This commit is contained in:
parent
40bfb55370
commit
e143158f12
@ -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')
|
||||
|
@ -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
|
||||
|
||||
|
@ -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', {
|
||||
|
Loading…
Reference in New Issue
Block a user