mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use shared sanity check and tests ipapython.dnsutil.is_auto_empty_zone()
https://fedorahosted.org/freeipa/ticket/5710 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Petr Vobornik
parent
6752d6404a
commit
1df30b4646
@@ -188,6 +188,18 @@ def assert_absolute_dnsname(name):
|
|||||||
|
|
||||||
|
|
||||||
def is_auto_empty_zone(zone):
|
def is_auto_empty_zone(zone):
|
||||||
"""True if specified zone name exactly matches an automatic empty zone."""
|
"""True if specified zone name exactly matches an automatic empty zone.
|
||||||
assert isinstance(zone, DNSName)
|
|
||||||
|
>>> is_auto_empty_zone(DNSName('in-addr.arpa.'))
|
||||||
|
False
|
||||||
|
>>> is_auto_empty_zone(DNSName('10.in-addr.arpa.'))
|
||||||
|
True
|
||||||
|
>>> is_auto_empty_zone(DNSName('1.10.in-addr.arpa.'))
|
||||||
|
False
|
||||||
|
>>> is_auto_empty_zone(DNSName('10.in-addr.arpa'))
|
||||||
|
Traceback (most recent call last):
|
||||||
|
...
|
||||||
|
AssertionError: ...
|
||||||
|
"""
|
||||||
|
assert_absolute_dnsname(zone)
|
||||||
return zone in EMPTY_ZONES
|
return zone in EMPTY_ZONES
|
||||||
|
|||||||
Reference in New Issue
Block a user