Allow dict parameters for primary_mac_address #1464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
#1413
New Behavior
Allowing raw parameters permits the following construct to lookup mac addresses in a different way to get an unique object, for example by id:
Contrast to Current Behavior
Coercing
primary_mac_address
to str prevents using dict constructs to point to a specific object in netbox, instead always searching for an entry with the plaintext mac.This key for the object is not guaranteed to be unique, resulting in errors when multiple objects are returned.
Discussion: Benefits and Drawbacks
This fixes a bug when the same mac address is used by multiple items in netbox 4.2+
Changes to the Documentation
No changes (this allows the already-documented construct described here to be used)
Proposed Release Note Entry
netbox_device_interface: Fix assigning
primary_mac_address
by idDouble Check
devel
branch.