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

oob_ips & primary_ip's are deleted when a device is deleted #13938

Closed
ITJamie opened this issue Sep 29, 2023 · 1 comment
Closed

oob_ips & primary_ip's are deleted when a device is deleted #13938

ITJamie opened this issue Sep 29, 2023 · 1 comment
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@ITJamie
Copy link
Contributor

ITJamie commented Sep 29, 2023

NetBox version

v3.6.3

Python version

3.10

Steps to Reproduce

  1. create a device
  2. assign an IP to two interfaces
  3. assign an IP to both oob_ip and primary_ip
  4. delete device
  5. look at changelog, the ips will have been deleted,

Expected Behavior

the ips should become unassigned from the device, not deleted

ref: #6015 - here deleting of ips when interfaces were deleted was disabled

Observed Behavior

oob_ip/primary_ip assigned addresses are deleted.
this is unexpected as the field models have on_delete=models.SET_NULL configured

@ITJamie ITJamie added the type: bug A confirmed report of unexpected behavior in the application label Sep 29, 2023
@ITJamie
Copy link
Contributor Author

ITJamie commented Sep 29, 2023

device before deletion:
Screenshot 2023-09-29 at 21 31 25

changelog showing deleted ips:
Screenshot 2023-09-29 at 21 32 04

I noticed this when working on #13690. there the deletion modal I adjusted was showing oob_ip's and primary_ips were up for deletion...

I may have my logic backwards here when it comes to the on_delete=models.SET_NULL direction. However I still consider it surprising that primary_ip's or oob_ip's would be deleted on deletion of a device

@ITJamie ITJamie closed this as completed Sep 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant