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

Updated netbox_circuit_termination.py to support NetBox 4.2.x #1402

Merged
merged 6 commits into from
Mar 30, 2025

Conversation

nsthompson
Copy link
Contributor

@nsthompson nsthompson commented Mar 24, 2025

Related Issue

#1401

New Behavior

This fix is to resolve the changes created by the NetBox 4.2.0 release relating to:

The site and provider_network foreign key fields on circuits.CircuitTermination have been replaced by the termination generic foreign key.

Contrast to Current Behavior

Current behavior results in module failure with the error:

A circuit termination must attach to a terminating object.

Discussion: Benefits and Drawbacks

This fix resolves the issue with NetBox 4.2.x. It is backward compatible with prior versions.

Changes to the Documentation

Documentation in the module has been updated.

Proposed Release Note Entry

Updated netbox_circuit_termination.py to support NetBox 4.2.x breaking changes.

Double Check

  • [ x ] I have read the comments and followed the CONTRIBUTING.md.
  • [ x ] I have explained my PR according to the information in the comments or in a linked issue.
  • [ x ] My PR targets the devel branch.

@sc68cal
Copy link
Contributor

sc68cal commented Mar 25, 2025

This needs to be done in a way that preserves backwards compatibility with older NetBox versions since we still use those for CI tests, and we have by convention supported the two most recent releases, which at this point would be 4.2 and 4.1

@nsthompson
Copy link
Contributor Author

nsthompson commented Mar 25, 2025

This needs to be done in a way that preserves backwards compatibility with older NetBox versions since we still use those for CI tests, and we have by convention supported the two most recent releases, which at this point would be 4.2 and 4.1

Thanks for the feedback, @sc68cal. I just pushed new changes that preserve backward compatibility and prevent parameter overlap between the params required for versions pre-4.2.0 and those for versions 4.2.0 and later.

The fix was tested against NetBox Cloud running 4.1.11 as well as 4.2.5.

@sc68cal
Copy link
Contributor

sc68cal commented Mar 25, 2025

Looks good, just some small style changes for black to be happy, and then a changelog fragment and then I think this is good to go

@sc68cal
Copy link
Contributor

sc68cal commented Mar 27, 2025

Doc build failure appears unrelated to your changes.

@rodvand rodvand merged commit cd0b654 into netbox-community:devel Mar 30, 2025
61 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants