mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Move function is_auto_empty_zone() into ipapython.dnsutil
I'm going to extend this so it is better to have it in module. At the same time it is now using shared assert_absolute_dnsname() helper. https://fedorahosted.org/freeipa/ticket/5710 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
41464b74f4
commit
6752d6404a
@ -185,3 +185,9 @@ def assert_absolute_dnsname(name):
|
|||||||
assert isinstance(name, DNSName), ("name must be DNSName instance, "
|
assert isinstance(name, DNSName), ("name must be DNSName instance, "
|
||||||
"got '%s'" % type(name))
|
"got '%s'" % type(name))
|
||||||
assert name.is_absolute(), "name must be absolute, got '%s'" % name
|
assert name.is_absolute(), "name must be absolute, got '%s'" % name
|
||||||
|
|
||||||
|
|
||||||
|
def is_auto_empty_zone(zone):
|
||||||
|
"""True if specified zone name exactly matches an automatic empty zone."""
|
||||||
|
assert isinstance(zone, DNSName)
|
||||||
|
return zone in EMPTY_ZONES
|
||||||
|
@ -52,7 +52,7 @@ from ipapython.ipa_log_manager import root_logger
|
|||||||
from ipapython import config
|
from ipapython import config
|
||||||
from ipaplatform.paths import paths
|
from ipaplatform.paths import paths
|
||||||
from ipapython.dn import DN
|
from ipapython.dn import DN
|
||||||
from ipapython.dnsutil import DNSName, EMPTY_ZONES
|
from ipapython.dnsutil import DNSName, is_auto_empty_zone
|
||||||
|
|
||||||
SHARE_DIR = paths.USR_SHARE_IPA_DIR
|
SHARE_DIR = paths.USR_SHARE_IPA_DIR
|
||||||
PLUGINS_SHARE_DIR = paths.IPA_PLUGINS
|
PLUGINS_SHARE_DIR = paths.IPA_PLUGINS
|
||||||
@ -1065,12 +1065,6 @@ def check_zone_overlap(zone, raise_on_error=True):
|
|||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
|
||||||
def is_auto_empty_zone(zone):
|
|
||||||
"""True if specified zone name exactly matches an automatic empty zone."""
|
|
||||||
assert isinstance(zone, DNSName)
|
|
||||||
return zone in EMPTY_ZONES
|
|
||||||
|
|
||||||
|
|
||||||
def config_replace_variables(filepath, replacevars=dict(), appendvars=dict()):
|
def config_replace_variables(filepath, replacevars=dict(), appendvars=dict()):
|
||||||
"""
|
"""
|
||||||
Take a key=value based configuration file, and write new version
|
Take a key=value based configuration file, and write new version
|
||||||
|
Loading…
Reference in New Issue
Block a user