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

Cannot move primary IP from device to VM or vice versa #14482

Closed
devon-mar opened this issue Dec 10, 2023 · 1 comment · Fixed by #14514
Closed

Cannot move primary IP from device to VM or vice versa #14482

devon-mar opened this issue Dec 10, 2023 · 1 comment · Fixed by #14514
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@devon-mar
Copy link
Contributor

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.8

Steps to Reproduce

  1. Add an IP to a device and set it as the device's primary IP address
  2. On a VM interface, assign the IP from step 1 and check "Make this the primary IP for the device/VM"
  3. On save, a ValueError is raised

This bug also works the other way around (VM to Device).

Expected Behavior

The IP address should be assigned to the VM interface.

Observed Behavior

<class 'ValueError'>

'IPAddressForm' has no field named 'assigned_object'.

Python version: 3.8.10
NetBox version: 3.6.6
Plugins: 
  netbox_demo: 0.3.1
@devon-mar devon-mar added the type: bug A confirmed report of unexpected behavior in the application label Dec 10, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Dec 12, 2023
@jeremystretch
Copy link
Member

To be clear, moving the primary IP for a device/VM is not supported. However, attempting to do so should return a validation error rather than raise an exception.

@DanSheps DanSheps self-assigned this Dec 13, 2023
@DanSheps DanSheps added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Dec 13, 2023
jeremystretch pushed a commit that referenced this issue Dec 28, 2023
* Fix validation when primary IP is moved.

* Fix views test

* Work on excluding assigned_objects

* Modify clean() on model and form to properly catch error

* Fix test failure

* Fix test to check for PK

* Remove model_form check
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available 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.

3 participants