modified: netbox_dns_bridge/request_handler.py
modified: netbox_dns_bridge/signals/netbox_dns_zones.py 1. On zone deletion the catalog zone serial was not incremented, causing clients not to delete the zone until another zone is created/modified. Fixed using post_delete signal. 2. Even with the notify_clients feature disabled, the client IPs were still being tracked. This disables the unnecessary behavior. 3. _track_seen_client function in DNSBaseRequestHandler did not have the 'self' reference parameter, causing calls to fail. Fixed.
This commit is contained in:
1 parent
b78ae930e7
commit
2a89f4ae75
2 files changed
+26
-15
No files matched your search
@@ -17,7 +17,7 @@ from netbox_dns_bridge import catalog_zone_manager as catzm
|
||||
from .models import SeenTransferClients
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
SETTINGS = settings.PLUGINS_CONFIG["netbox_dns_bridge"]
|
||||
|
||||
class DNSBaseRequestHandler(socketserver.BaseRequestHandler):
|
||||
def __init__(self, request, client_address, server) -> None:
|
||||
@@ -144,12 +144,13 @@ class DNSBaseRequestHandler(socketserver.BaseRequestHandler):
|
||||
wire = response.to_wire(multi=False)
|
||||
self._send_response(wire)
|
||||
|
||||
def _track_seen_client(source_ip: str, view: View) -> None:
|
||||
SeenTransferClients.objects.update_or_create(
|
||||
source_ip=source_ip,
|
||||
view=view,
|
||||
defaults={"last_seen": timezone.now()},
|
||||
)
|
||||
def _track_seen_client(self, source_ip: str, view: View) -> None:
|
||||
if SETTINGS.get("notify_clients", False):
|
||||
SeenTransferClients.objects.update_or_create(
|
||||
source_ip=source_ip,
|
||||
view=view,
|
||||
defaults={"last_seen": timezone.now()},
|
||||
)
|
||||
|
||||
def _handle_soa_request(self, query, soa_rrset, zone, peer, nb_view, dname) -> None:
|
||||
# We assume that the SOA rdataset has at least one record (it usually does).
|
||||
|
||||
Reference in new issue
Block a user