modified: CHANGELOG.md modified: netbox_dns_bridge/signals/netbox_dns_zones.py Defer catalog zone SOA serial increment to transaction.on_commit on zone deletion, matching the create/modify path and making delete rollback-safe
This commit is contained in:
1 parent
ddef4965d6
commit
e8762bf807
2 files changed
+6
No files matched your search
@@ -1,4 +1,7 @@
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
- Defer the catalog zone SOA serial increment on zone deletion to `transaction.on_commit`, matching
|
||||||
|
the create/modify path. Previously the increment ran immediately at `post_delete` time, so a
|
||||||
|
rollback of the delete transaction would have left the catalog serial bumped anyway.
|
||||||
- Add the option to send a NOTIFY directly to a zone's own nameservers when its SOA serial number
|
- Add the option to send a NOTIFY directly to a zone's own nameservers when its SOA serial number
|
||||||
changes. Enable it per zone via a boolean custom field named by `notify_ns_custom_field_name`,
|
changes. Enable it per zone via a boolean custom field named by `notify_ns_custom_field_name`,
|
||||||
globally for all zones via `notify_ns_all_zones` (default `False`), or both. Nameserver addresses
|
globally for all zones via `notify_ns_all_zones` (default `False`), or both. Nameserver addresses
|
||||||
|
|||||||
@@ -72,8 +72,11 @@ def zone_post_save(sender, instance, created, **kwargs):
|
|||||||
|
|
||||||
@receiver(post_delete, sender=Zone)
|
@receiver(post_delete, sender=Zone)
|
||||||
def zone_post_delete(sender, instance, **kwargs):
|
def zone_post_delete(sender, instance, **kwargs):
|
||||||
|
def _on_commit():
|
||||||
catzm.increment_soa_serial()
|
catzm.increment_soa_serial()
|
||||||
|
|
||||||
|
transaction.on_commit(_on_commit)
|
||||||
|
|
||||||
|
|
||||||
def _notify_ns_enabled(zone) -> bool:
|
def _notify_ns_enabled(zone) -> bool:
|
||||||
"""Return True if a NOTIFY to the zone's nameservers should be sent.
|
"""Return True if a NOTIFY to the zone's nameservers should be sent.
|
||||||
|
|||||||
Reference in new issue
Block a user