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

Removing Module Bays with Children Power Ports breaks Power Ports count #14081

Closed
Breadberry07 opened this issue Oct 19, 2023 · 1 comment · Fixed by #14131
Closed

Removing Module Bays with Children Power Ports breaks Power Ports count #14081

Breadberry07 opened this issue Oct 19, 2023 · 1 comment · Fixed by #14131
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@Breadberry07
Copy link

Breadberry07 commented Oct 19, 2023

NetBox version

v3.6.4

Python version

3.8

Steps to Reproduce

  1. Create module types for device (for example PWR-MX960-4100-AC with 2 power ports):
    image
  2. In Devices add to chassis device (for example mx960) PEM module:
    image
  3. Check count Power Ports:
    image
  4. Delete module from device:
    image

Expected Behavior

For the Power Ports count to be correct

Observed Behavior

The port counter has not decreased

@Breadberry07 Breadberry07 added the type: bug A confirmed report of unexpected behavior in the application label Oct 19, 2023
@kkthxbye-code
Copy link
Contributor

Similarly removing a rearport that is associated with a frontport will not decrement the rearport count. Deleting an inventory item that has children also does not account for the children in the count, so deleting an inventoryitem named parent_inventoryitem that has one child inventory item child_inventoryitem will decrese the counter by 1 instead of 2.

I assume the counting logic is broken for any and all CASCADE deleted objects.

@arthanson arthanson self-assigned this Nov 18, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Nov 29, 2023
jeremystretch added a commit that referenced this issue Dec 12, 2023
…14131)

* 14081 fixed cached counters on delete for parent-child items

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants