Allow dict parameter query for primary_mac_address in netbox_vm_interface #1510
+320
−247
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.
Allow dict parameter query for primary_mac_address in netbox_vm_interface module
Related Issue
#1509
New Behavior
This PR adds the ability to query for a primary_mac_address by ID for vm interfaces. Example of new behavior:
This PR also addresses a potential bug. The primary_mac_address was not specified under QUERY_TYPES in netbox_utils.py and as a result querys by ID would also result in matching mac addresses whose value contains the ID number (so if the MAC is 00:01:02:03:42:43 and the ID of another MAC address object is 42, then the query would return both a fail.
Contrast to Current Behavior
Currently, a primary_mac_address may only be assigned by its value.
Discussion: Benefits and Drawbacks
This is also related to #1413 as-well-as the PR submitted to fix that issue #1464 where duplicate mac addresses meant assigning a primary_mac_address to device interfaces was not always possible. This PR adds that same functionality to vm interfaces. The original behavior of specifying a primary_mac_address by value is still supported.
Proposed Release Note Entry
Allow dict parameter query for primary_mac_address in netbox_vm_interface module.
Double Check
develbranch.