1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
This commit is contained in:
jeremystretch
2022-07-07 12:48:44 -04:00
parent 1beb8522b9
commit 9a7f3f8c1a
17 changed files with 169 additions and 170 deletions

View File

@@ -1,3 +1,5 @@
import itertools
from django.contrib.contenttypes.models import ContentType
from django.db import transaction
@@ -29,16 +31,6 @@ def path_node_to_object(repr):
return ct.model_class().objects.get(pk=object_id)
def flatten_path(path):
"""
Flatten a two-dimensional array (list of lists) into a flat list.
"""
ret = []
for step in path:
ret.extend(step)
return ret
def create_cablepath(terminations):
"""
Create CablePaths for all paths originating from the specified set of nodes.
@@ -54,7 +46,7 @@ def create_cablepath(terminations):
def rebuild_paths(terminations):
"""
Rebuild all CablePaths which traverse the specified node
Rebuild all CablePaths which traverse the specified nodes.
"""
from dcim.models import CablePath