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

Closed
opened 2025-12-29 17:24:58 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Feb 1, 2019).

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.

Originally created by @jeremystretch on GitHub (Feb 1, 2019). ### 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.
adam added the type: bugstatus: accepted labels 2025-12-29 17:24:58 +01:00
adam closed this issue 2025-12-29 17:24:59 +01:00
Author
Owner

@tvberlin commented on GitHub (Feb 13, 2019):

@jeremystretch thanks for implementing!

@tvberlin commented on GitHub (Feb 13, 2019): @jeremystretch thanks for implementing!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2339