From 6752d6404af13a933105e53ea5875adfb933e293 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Mon, 7 Mar 2016 13:30:35 +0100 Subject: 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 --- ipapython/dnsutil.py | 6 ++++++ ipapython/ipautil.py | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'ipapython') diff --git a/ipapython/dnsutil.py b/ipapython/dnsutil.py index 7f0a094f2..6ff500b22 100644 --- a/ipapython/dnsutil.py +++ b/ipapython/dnsutil.py @@ -185,3 +185,9 @@ def assert_absolute_dnsname(name): assert isinstance(name, DNSName), ("name must be DNSName instance, " "got '%s'" % type(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 diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index 4c9693368..4597f1c63 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -52,7 +52,7 @@ from ipapython.ipa_log_manager import root_logger from ipapython import config from ipaplatform.paths import paths 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 PLUGINS_SHARE_DIR = paths.IPA_PLUGINS @@ -1065,12 +1065,6 @@ def check_zone_overlap(zone, raise_on_error=True): 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()): """ Take a key=value based configuration file, and write new version -- cgit