From 3711261802db1f6ce09de6371a9ea59e542e3d63 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 12 Jan 2011 21:02:05 +0100 Subject: Port installer and host plugin to the new DNS plugin * move ipa dns-resolve to the new plugin * port the installer and the host plugin to the new interface * remove the old plugin --- ipaserver/install/bindinstance.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'ipaserver/install/bindinstance.py') diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index e1a5810f..4cf9f94c 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -107,8 +107,8 @@ def get_reverse_zone(ip_address): def dns_zone_exists(name): try: - zone = api.Command.dns_show(unicode(name)) - except Exception: + zone = api.Command.dnszone_show(unicode(name)) + except ipalib.errors.NotFound: return False if len(zone) == 0: @@ -121,11 +121,11 @@ def add_zone(name, update_policy=None, zonemgr=None, dns_backup=None): update_policy = "grant %s krb5-self * A;" % api.env.realm try: - api.Command.dns_add(unicode(name), - idnssoamname=unicode(api.env.host+"."), - idnssoarname=unicode(zonemgr), - idnsallowdynupdate=True, - idnsupdatepolicy=unicode(update_policy)) + api.Command.dnszone_add(unicode(name), + idnssoamname=unicode(api.env.host+"."), + idnssoarname=unicode(zonemgr), + idnsallowdynupdate=True, + idnsupdatepolicy=unicode(update_policy)) except (errors.DuplicateEntry, errors.EmptyModlist): pass @@ -138,10 +138,10 @@ def add_reverze_zone(ip_address, update_policy=None, dns_backup=None): if not update_policy: update_policy = "grant %s krb5-subdomain %s. PTR;" % (api.env.realm, zone) try: - api.Command.dns_add(unicode(zone), - idnssoamname=unicode(api.env.host+"."), - idnsallowdynupdate=True, - idnsupdatepolicy=unicode(update_policy)) + api.Command.dnszone_add(unicode(zone), + idnssoamname=unicode(api.env.host+"."), + idnsallowdynupdate=True, + idnsupdatepolicy=unicode(update_policy)) except (errors.DuplicateEntry, errors.EmptyModlist): pass @@ -150,9 +150,9 @@ def add_reverze_zone(ip_address, update_policy=None, dns_backup=None): return zone def add_rr(zone, name, type, rdata, dns_backup=None): + addkw = { '%srecord' % unicode(type.lower()) : unicode(rdata) } try: - api.Command.dns_add_rr(unicode(zone), unicode(name), - unicode(type), unicode(rdata)) + api.Command.dnsrecord_add(unicode(zone), unicode(name), **addkw) except (errors.DuplicateEntry, errors.EmptyModlist): pass if dns_backup: @@ -201,8 +201,8 @@ class DnsBackup(object): if have_ldap: type, host, rdata = dns_record.split(" ", 2) try: - api.Command.dns_del_rr(unicode(zone), unicode(host), - unicode(type), unicode(rdata)) + delkw = { '%srecord' % unicode(type.lower()) : unicode(rdata) } + api.Command.dnsrecord_del(unicode(zone), unicode(host), **delkw) except: pass j += 1 -- cgit