Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front/reat port connection always shows B side of connected cable #2844

Closed
jeremystretch opened this issue Feb 1, 2019 · 1 comment
Closed
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.5

Steps to Reproduce

  1. Create or find a front or rear pass-through port with a connected cable.

Expected Behavior

The "front ports" and "rear ports" tables on the device view should list the far end of each attached cable.

Observed Behavior

The B side is always listed. This is due to a bug in the get_cable_peer() method:

def get_cable_peer(self):
    if self.cable is None:
        return None
    if self._cabled_as_a:
        return self.cable.termination_b
    if self._cabled_as_b:
        return self.cable.termination_a

The _cabled_as_x methods each return a generic relation manager, whereas what we need is the queryset.

@tvberlin
Copy link

@jeremystretch thanks for implementing!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants