Skip to content

Update Report for checking for lonely cables #6826

Answered by candlerb
SteveHauke asked this question in Q&A
Discussion options

You must be logged in to vote

You want to check whether the path which the cable is part of, ends on an Interface at both ends, rather than on a frontport or rearport.

Look at the code here which identifies all the paths which pass through the termination (in general, if it were a rearport rather than a frontport, multiple paths could pass through it).

I believe the CablePath will only exist if there are interfaces at both ends. The condition then becomes something like this (you may need to experiment a bit with it in nbshell):

if CablePath.objects.filter(path__contains=cable.termination_a).count() == 0:
    self.log_failure(cable, "Cable is not connected to two endpoints")

I'd also point out that looking at string …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SteveHauke
Comment options

@candlerb
Comment options

Answer selected by ryanmerolle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants