Skip to content

Commit

Permalink
fixes issue with handling IPAddresses which are assigned to new inter…
Browse files Browse the repository at this point in the history
…faces #361
  • Loading branch information
bb-Ricardo committed Feb 1, 2024
1 parent acd435d commit b381b0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/netbox/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,13 @@ def update_object(self, nb_object_sub_class, unset=False, last_run=False):
else:
data_to_patch[key] = value

# special case for IP address
if isinstance(this_object, NBIPAddress):
# if object is new and and has no id, then we need to remove assigned_object_type from data_to_patch
if "assigned_object_id" in unresolved_dependency_data.keys() and \
"assigned_object_type" in data_to_patch.keys():
del data_to_patch["assigned_object_type"]

issued_request = False
returned_object_data = None
if len(data_to_patch.keys()) > 0:
Expand Down

0 comments on commit b381b0f

Please sign in to comment.