mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-27 09:21:59 -06:00
parent
acc437c5fe
commit
46dbf0ae55
@ -156,7 +156,7 @@ def add_reverse_zone(ip_address, update_policy=None, dns_backup=None):
|
|||||||
return zone
|
return zone
|
||||||
|
|
||||||
def add_rr(zone, name, type, rdata, dns_backup=None, **kwargs):
|
def add_rr(zone, name, type, rdata, dns_backup=None, **kwargs):
|
||||||
addkw = { '%srecord' % unicode(type.lower()) : unicode(rdata) }
|
addkw = { '%srecord' % str(type.lower()) : unicode(rdata) }
|
||||||
addkw.update(kwargs)
|
addkw.update(kwargs)
|
||||||
try:
|
try:
|
||||||
api.Command.dnsrecord_add(unicode(zone), unicode(name), **addkw)
|
api.Command.dnsrecord_add(unicode(zone), unicode(name), **addkw)
|
||||||
@ -177,7 +177,7 @@ def add_ptr_rr(ip_address, fqdn, dns_backup=None):
|
|||||||
add_rr(zone, name, "PTR", fqdn+".", dns_backup)
|
add_rr(zone, name, "PTR", fqdn+".", dns_backup)
|
||||||
|
|
||||||
def del_rr(zone, name, type, rdata):
|
def del_rr(zone, name, type, rdata):
|
||||||
delkw = { '%srecord' % unicode(type.lower()) : unicode(rdata) }
|
delkw = { '%srecord' % str(type.lower()) : unicode(rdata) }
|
||||||
try:
|
try:
|
||||||
api.Command.dnsrecord_del(unicode(zone), unicode(name), **delkw)
|
api.Command.dnsrecord_del(unicode(zone), unicode(name), **delkw)
|
||||||
except (errors.NotFound, errors.EmptyModlist):
|
except (errors.NotFound, errors.EmptyModlist):
|
||||||
@ -232,7 +232,7 @@ class DnsBackup(object):
|
|||||||
if have_ldap:
|
if have_ldap:
|
||||||
type, host, rdata = dns_record.split(" ", 2)
|
type, host, rdata = dns_record.split(" ", 2)
|
||||||
try:
|
try:
|
||||||
delkw = { '%srecord' % unicode(type.lower()) : unicode(rdata) }
|
delkw = { '%srecord' % str(type.lower()) : unicode(rdata) }
|
||||||
api.Command.dnsrecord_del(unicode(zone), unicode(host), **delkw)
|
api.Command.dnsrecord_del(unicode(zone), unicode(host), **delkw)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user