Handle traces which split at a RearPort

This commit is contained in:
Jeremy Stretch
2020-10-08 13:45:47 -04:00
parent 29eebf9fbe
commit 0c5efa243d
5 changed files with 82 additions and 29 deletions

View File

@@ -1,7 +1,6 @@
from django.contrib.contenttypes.models import ContentType
from .choices import CableStatusChoices
from .exceptions import CableTraceSplit
def compile_path_node(ct_id, object_id):
@@ -69,8 +68,8 @@ def trace_path(node):
node = FrontPort.objects.get(rear_port=peer_termination, rear_port_position=position)
path.append(object_to_path_node(node))
else:
# No position indicated: path has split (probably invalid?)
raise CableTraceSplit(peer_termination)
# No position indicated: path has split, so we stop at the RearPort
break
# Anything else marks the end of the path
else: