Skip to content

Commit 66d5cb8

Browse files
Added back logic, but made it more specific if a user passes in assigned_object (#423)
1 parent 14a1065 commit 66d5cb8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

plugins/module_utils/netbox_utils.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,20 @@ def _build_query_params(
716716
else:
717717
query_dict.update({"device": module_data["device"]})
718718

719+
elif (
720+
parent == "ip_address"
721+
and "assigned_object" in matches
722+
and module_data.get("assigned_object_type")
723+
):
724+
if module_data["assigned_object_type"] == "virtualization.vminterface":
725+
query_dict.update(
726+
{"vminterface_id": module_data.get("assigned_object_id")}
727+
)
728+
elif module_data["assigned_object_type"] == "dcim.interface":
729+
query_dict.update(
730+
{"interface_id": module_data.get("assigned_object_id")}
731+
)
732+
719733
elif parent == "virtual_chassis":
720734
query_dict = {"q": self.module.params["data"].get("master")}
721735

0 commit comments

Comments
 (0)