diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2013-04-12 15:20:07 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-04-16 15:50:24 +0200 |
commit | a730b6e7b5e4eca754022fd3e0112ef597888c3b (patch) | |
tree | 224bb29ab953d696fe7eb8b9ea106d60c47a3a0f /ipalib/plugins/dns.py | |
parent | e736e75ce9724ae8298a5b69d093313cd6e62b60 (diff) | |
download | freeipa-a730b6e7b5e4eca754022fd3e0112ef597888c3b.tar.gz freeipa-a730b6e7b5e4eca754022fd3e0112ef597888c3b.tar.xz freeipa-a730b6e7b5e4eca754022fd3e0112ef597888c3b.zip |
Integrate realmdomains with IPA DNS
Add an entry to realmdomains when a DNS zone is added to IPA.
Delete the related entry from realmdomains when the DNS zone is deleted
from IPA.
Add _kerberos TXT record to DNS zone when a new realmdomain is added.
Delete _kerberos TXT record from DNS zone when realmdomain is deleted.
Add unit tests to cover new functionality.
https://fedorahosted.org/freeipa/ticket/3544
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r-- | ipalib/plugins/dns.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index becec1423..d59df59a2 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -1841,6 +1841,18 @@ class dnszone_add(LDAPCreate): dns_record, nameserver_ip_address) + # Add entry to realmdomains + # except for our own domain, forwarded zones and reverse zones + zone = keys[0] + + if (zone != api.env.domain + and not options.get('idnsforwarders') + and not zone_is_reverse(zone)): + try: + api.Command['realmdomains_mod'](add_domain=zone, force=True) + except errors.EmptyModlist: + pass + return dn api.register(dnszone_add) @@ -1857,6 +1869,17 @@ class dnszone_del(LDAPDelete): force=True) except errors.NotFound: pass + + # Delete entry from realmdomains + # except for our own domain + zone = keys[0] + + if zone != api.env.domain: + try: + api.Command['realmdomains_mod'](del_domain=zone, force=True) + except errors.AttrValueNotFound: + pass + return True api.register(dnszone_del) |