summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
authorAna Krivokapic <akrivoka@redhat.com>2013-02-12 10:50:00 -0500
committerAlexander Bokovoy <abokovoy@redhat.com>2013-02-19 14:15:46 +0200
commit3253a305416c963fcdc2670caa2c22c167ccc0d2 (patch)
tree4ba1ebb4c40f877c58bdd7b47a58f36196d12360 /ipalib/util.py
parent8fcc8bc8d50d266b050c136de7a441d59e363d1b (diff)
downloadfreeipa-3253a305416c963fcdc2670caa2c22c167ccc0d2.tar.gz
freeipa-3253a305416c963fcdc2670caa2c22c167ccc0d2.tar.xz
freeipa-3253a305416c963fcdc2670caa2c22c167ccc0d2.zip
Add list of domains associated to our realm to cn=etc
Add new LDAP container to store the list of domains associated with IPA realm. Add two new ipa commands (ipa realmdomains-show and ipa realmdomains-mod) to allow manipulation of the list of realm domains. Unit test file covering these new commands was added. https://fedorahosted.org/freeipa/ticket/2945
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index a92e68c4a..9ed27c84e 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -105,6 +105,27 @@ def validate_host_dns(log, fqdn):
)
raise errors.DNSNotARecordError()
+
+def has_soa_or_ns_record(domain):
+ """
+ Checks to see if given domain has SOA or NS record.
+ Returns True or False.
+ """
+ try:
+ resolver.query(domain, rdatatype.SOA)
+ soa_record_found = True
+ except DNSException:
+ soa_record_found = False
+
+ try:
+ resolver.query(domain, rdatatype.NS)
+ ns_record_found = True
+ except DNSException:
+ ns_record_found = False
+
+ return soa_record_found or ns_record_found
+
+
def normalize_name(name):
result = dict()
components = name.split('@')