mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
10201 more debug
This commit is contained in:
parent
1270bc8818
commit
8d37fb5eec
@ -438,6 +438,12 @@ class CablePath(models.Model):
|
||||
def __str__(self):
|
||||
return f"Path #{self.pk}: {len(self.path)} hops"
|
||||
|
||||
def dump(self):
|
||||
print("")
|
||||
print(f"Cable Path: {self}")
|
||||
print(f"path: {self.path}")
|
||||
print(f"_nodes: {self._nodes}")
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
||||
# Save the flattened nodes list
|
||||
@ -505,7 +511,7 @@ class CablePath(models.Model):
|
||||
|
||||
# Ensure all originating terminations are attached to the same link
|
||||
if len(terminations) > 1:
|
||||
print(f"terminations[0].link: {terminations[0].link}")
|
||||
print(f"terminations[0]: {terminations[0]} terminations[0].link: {terminations[0].link}")
|
||||
for t in terminations[1:]:
|
||||
print(f"t: {t} t.link: {t.link}")
|
||||
assert all(t.link == terminations[0].link for t in terminations[1:])
|
||||
|
@ -56,5 +56,6 @@ def rebuild_paths(terminations):
|
||||
|
||||
with transaction.atomic():
|
||||
for cp in cable_paths:
|
||||
cp.dump()
|
||||
cp.delete()
|
||||
create_cablepath(cp.origins)
|
||||
|
Loading…
Reference in New Issue
Block a user