peteeckel/netbox-plugin-dns

When an address record is updated, the PTR record for it is saved even if if didn't change

Closed this issue · 0 comments

Versions
NetBox Version: 4.0.2
NetBox DNS Version: 1.0.1
Python Version: 3.11.5

Describe the bug
When writing the tests for the #89, I found that some changes to address records were handled inefficienty, leading to the redunsant invocation of event rules.

To Reproduce
Steps to reproduce the behavior:

  1. Create an event rule and a webhook for Record | update
  2. Create a forward and a reverse zone
  3. Create an address record that has a PTR record in the reverse zone
  4. Verify both records are present
  5. Now add tags to the address record without changing anything else and watch for event rule invocations

Expected result
One event rule is triggered for the address record, and none for the PTR record

Actual result
One event rule is triggered for both.

What's causing this is that the PTR record is saved whenever its address record is saved, even if nothing at all changed in its values.