modified: netbox_dns_bridge/catalog_zone_manager.py

modified:   netbox_dns_bridge/utils.py
Black reformat
This commit is contained in:
Sven Luethi authored and Sven Luthi committed 2026-08-11 18:29:29 +02:00
1 parent 2276d770d1
commit edd57dd6f7
2 files changed
+5 -5

No files matched your search

+4 -3
View File
@@ -15,12 +15,13 @@ LOGGER = get_logger(__name__)
def increment_soa_serial() -> int: def increment_soa_serial() -> int:
with transaction.atomic(): with transaction.atomic():
try: try:
soa_serial_obj, _ = ( (
IntegerKeyValueSetting.objects.select_for_update().get_or_create( soa_serial_obj,
_,
) = IntegerKeyValueSetting.objects.select_for_update().get_or_create(
key="catalog-zone-soa-serial", key="catalog-zone-soa-serial",
defaults={"value": 1}, defaults={"value": 1},
) )
)
new_soa_serial = soa_serial_obj.value + 1 new_soa_serial = soa_serial_obj.value + 1
if new_soa_serial > 0xFFFFFFFF: if new_soa_serial > 0xFFFFFFFF:
+1 -2
View File
@@ -42,8 +42,7 @@ def build_dns_zone(nb_zone: netbox_dns.models.Zone) -> dns.zone.Zone:
# an unquoted value to be larger then 255 characters, # an unquoted value to be larger then 255 characters,
# it misunderstood everything behind a ; as a comment. # it misunderstood everything behind a ; as a comment.
chunks = [ chunks = [
'"{}"'.format(value[i : i + 255]) '"{}"'.format(value[i : i + 255]) for i in range(0, len(value), 255)
for i in range(0, len(value), 255)
] ]
value = " ".join(chunks) value = " ".join(chunks)
else: else: