mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Fix support for tracing across bridge relationships
This commit is contained in:
parent
a858e041e4
commit
d444aa1110
@ -59,7 +59,7 @@ class PathEndpointMixin(object):
|
|||||||
width = int(request.GET.get('width', CABLE_TRACE_SVG_DEFAULT_WIDTH))
|
width = int(request.GET.get('width', CABLE_TRACE_SVG_DEFAULT_WIDTH))
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
width = CABLE_TRACE_SVG_DEFAULT_WIDTH
|
width = CABLE_TRACE_SVG_DEFAULT_WIDTH
|
||||||
drawing = CableTraceSVG(self, base_url=request.build_absolute_uri('/'), width=width)
|
drawing = CableTraceSVG(obj, base_url=request.build_absolute_uri('/'), width=width)
|
||||||
return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
|
return HttpResponse(drawing.render().tostring(), content_type='image/svg+xml')
|
||||||
|
|
||||||
# Serialize path objects, iterating over each three-tuple in the path
|
# Serialize path objects, iterating over each three-tuple in the path
|
||||||
|
@ -211,10 +211,10 @@ class PathEndpoint(models.Model):
|
|||||||
# by inserting empty entries immediately prior to the path's destination node(s)
|
# by inserting empty entries immediately prior to the path's destination node(s)
|
||||||
path.append([])
|
path.append([])
|
||||||
|
|
||||||
# TODO: Add bridging support
|
# Check for a bridged relationship to continue the trace
|
||||||
# # Check for bridge interface to continue the trace
|
destinations = origin._path.destinations
|
||||||
# origin = getattr(origin._path.destination, 'bridge', None)
|
if len(destinations) == 1:
|
||||||
origin = None
|
origin = getattr(destinations[0], 'bridge', None)
|
||||||
|
|
||||||
# Return the path as a list of three-tuples (A termination(s), cable(s), B termination(s))
|
# Return the path as a list of three-tuples (A termination(s), cable(s), B termination(s))
|
||||||
return list(zip(*[iter(path)] * 3))
|
return list(zip(*[iter(path)] * 3))
|
||||||
|
Loading…
Reference in New Issue
Block a user