- Store catz member zone identifiers in database, linked to the corresponding zone object.
- Catz member identifiers are created from uuid encoded in base32, lower-cased, and padding removed. - On endpoint startup, make sure all zones have a catz identifier assigned. If not, create them. - Use signals to create or update a zone's catz identifier.
This commit is contained in:
1 parent
1fae3bfe54
commit
9afdfe869b
8 files changed
+185
-16
No files matched your search
@@ -4,6 +4,7 @@ import dns.rdatatype
|
||||
import dns.rdataclass
|
||||
import dns.exception
|
||||
import netbox_dns.models
|
||||
import uuid, base64
|
||||
|
||||
def export_bind_zone_file(nb_zone: netbox_dns.models.Zone, file_path: str):
|
||||
|
||||
@@ -33,3 +34,6 @@ def export_bind_zone_file(nb_zone: netbox_dns.models.Zone, file_path: str):
|
||||
except IOError as e:
|
||||
raise IOError(f"Failed to write zone file to {file_path}: {e}")
|
||||
|
||||
|
||||
def generate_catz_member_identifier():
|
||||
return base64.b32encode(uuid.uuid4().bytes)[0:26].lower().decode('UTF-8')
|
||||
Reference in new issue
Block a user