Skip to content

Front ports with linked rear ports cannot be serialized #745

@alryaz

Description

@alryaz

pynetbox version

v7.6.1

NetBox version

v4.5.1

Python version

3.12

Steps to Reproduce

  1. Create a patch panel with 1:1 port mapping (front-rear)
  2. Issue a command to, say, update labels:
for port in nb.dcim.front_ports.filter(device_id=823):
  port.update({"label": "This is some label"})

Expected Behavior

Front port labels updated

Observed Behavior

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 678, in update
    return self.save()
           ^^^^^^^^^^^
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 640, in save
    updates = self.updates()
              ^^^^^^^^^^^^^^
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 617, in updates
    diff = self._diff()
           ^^^^^^^^^^^^
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 593, in _diff
    current = Hashabledict({fmt_dict(k, v) for k, v in self.serialize().items()})
                                                       ^^^^^^^^^^^^^^^^
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 573, in serialize
    v = v.id
        ^^^^
  File "/home/alryaz/.local/lib/python3.12/site-packages/pynetbox/core/response.py", line 328, in __getattr__
    raise AttributeError('object has no attribute "{}"'.format(k))
AttributeError: object has no attribute "id"

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: pynetboxseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: bugA confirmed report of unexpected behavior in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions