You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
as stated in this discussion #164 the param set_primary_ip setted to always will trigger an http patch even when the primary ip is not changed.
Some clarification logs:
2022-04-08 10:44:32,539 - DEBUG2: Trying to find prefix for IP: 192.168.9.9/24
2022-04-08 10:44:32,568 - DEBUG2: No matching NetBox prefix for '192.168.9.9/24' found
2022-04-08 10:44:32,615 - DEBUG2: Found existing NetBox IP address object: 192.168.9.9/24
2022-04-08 10:44:32,616 - DEBUG2: Parsing 'IP address' data structure: 192.168.9.9/24
2022-04-08 10:44:32,640 - DEBUG: Setting IP '192.168.9.9/24' as primary IPv4 for 'some_fqdn_machine'
2022-04-08 10:44:32,641 - DEBUG2: Parsing 'virtual machine' data structure: some_fqdn_machine
netbox-sync_1 | 2022-04-08 10:44:32,641 - INFO: Virtual machine 'some_fqdn_machine' attribute 'primary_ip4' changed from '{'id': 846, 'url': 'http://netbox:8080/api/ipam/ip-addresses/846/', 'display': '192.168.9.9/24', 'family': 4, 'address': '192.168.9.9/24'}' to '192.168.9.9/24'
2022-04-08 10:47:50,694 - INFO: Updating NetBox 'virtual machine' object 'some_fqdn_machine' with data: {'primary_ip4': 846}
2022-04-08 10:47:50,694 - DEBUG2: Sending PATCH to 'http://netbox:8080/api/virtualization/virtual-machines/22/' with data 'b'{"primary_ip4": 846}''.
2022-04-08 10:47:50,868 - DEBUG2: Received HTTP Status 200
The text was updated successfully, but these errors were encountered:
rizlas
changed the title
Set primary ip triggers http patch even without differences
Set primary ip to always triggers http patch even without differences
Apr 8, 2022
Again, great find thank you. I must have been sleeping when refactoring the data model initialisation last year.
in the VM data model the primary_ip4 and the primary_ip6 fields were not assigned the proper NBIPAddress. This way it was not resolved properly as a NetBox object. And when the comparing happened between the old and the new value they of course looked different which lead to the "issue".
Hi,
as stated in this discussion #164 the param
set_primary_ip
setted toalways
will trigger an http patch even when the primary ip is not changed.Some clarification logs:
The text was updated successfully, but these errors were encountered: