fix skip_ipv4 and skip_ipv6 for unifi records
Build and Push Container / build-and-push (push) Successful in 45s
Build and Push Container / build-and-push (push) Successful in 45s
This commit is contained in:
+8
-2
@@ -20,6 +20,8 @@ logger = logging.getLogger(__name__)
|
||||
class UnifiRecordType(TypedDict):
|
||||
record: str
|
||||
ttl_seconds: int
|
||||
skip_ipv4: bool | None
|
||||
skip_ipv6: bool | None
|
||||
|
||||
|
||||
class UnifiConfig(TypedDict):
|
||||
@@ -147,7 +149,7 @@ def update_records(
|
||||
ttl = record.get("ttl_seconds", 14400)
|
||||
logger.info("=== Processing UniFi record: %s (ttl=%s) ===", domain, ttl)
|
||||
|
||||
if ipv4:
|
||||
if ipv4 and not record.get("skip_ipv4"):
|
||||
existing = policy_map.get(f"{domain}:A_RECORD")
|
||||
if existing:
|
||||
logger.debug("Found existing A_RECORD policy for %s: id=%s, ip=%s",
|
||||
@@ -159,8 +161,10 @@ def update_records(
|
||||
"A_RECORD", domain, ipv4, ttl,
|
||||
existing,
|
||||
)
|
||||
elif ipv4 and record.get("skip_ipv4"):
|
||||
logger.info("Skipping IPv4 for %s (skip_ipv4=true)", domain)
|
||||
|
||||
if ipv6:
|
||||
if ipv6 and not record.get("skip_ipv6"):
|
||||
existing = policy_map.get(f"{domain}:AAAA_RECORD")
|
||||
if existing:
|
||||
logger.debug("Found existing AAAA_RECORD policy for %s: id=%s, ip=%s",
|
||||
@@ -172,5 +176,7 @@ def update_records(
|
||||
"AAAA_RECORD", domain, ipv6, ttl,
|
||||
existing,
|
||||
)
|
||||
elif ipv6 and record.get("skip_ipv6"):
|
||||
logger.info("Skipping IPv6 for %s (skip_ipv6=true)", domain)
|
||||
|
||||
logger.info("=== Done processing UniFi record: %s ===", domain)
|
||||
|
||||
Reference in New Issue
Block a user