diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-01-12 21:02:05 +0100 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-01-14 17:26:48 -0500 |
commit | 3711261802db1f6ce09de6371a9ea59e542e3d63 (patch) | |
tree | 4f6e1f2b33838854d681278d3dc27f91be9c0352 /ipaserver | |
parent | d7bd9138c803659bbcc3320a4656478ee73f2b3d (diff) | |
download | freeipa-3711261802db1f6ce09de6371a9ea59e542e3d63.tar.gz freeipa-3711261802db1f6ce09de6371a9ea59e542e3d63.tar.xz freeipa-3711261802db1f6ce09de6371a9ea59e542e3d63.zip |
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
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/bindinstance.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index e1a5810f4..4cf9f94c3 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 |