mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
dnspython: Add compatibility shim
`dnspython` 2.0.0 has many changes and several deprecations like: ``` > dns.resolver.resolve() has been added, allowing control of whether search lists are used. dns.resolver.query() is retained for backwards compatibility, but deprecated. The default for search list behavior can be set at in the resolver object with the use_search_by_default parameter. The default is False. > dns.resolver.resolve_address() has been added, allowing easy address-to-name lookups. ``` The new class `DNSResolver`: - provides the compatibility layer - defaults the previous behavior (the search list configured in the system's resolver configuration is used for relative names) - defaults lifetime to 15sec (determines the number of seconds to spend trying to get an answer to the question) Fixes: https://pagure.io/freeipa/issue/8383 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
committed by
Alexander Bokovoy
parent
fdb227e55a
commit
49e643783d
@@ -1193,7 +1193,7 @@ def _san_ip_update_reachable(reachable, dnsname, cname_depth):
|
||||
"""
|
||||
fqdn = dnsutil.DNSName(dnsname).make_absolute()
|
||||
try:
|
||||
zone = dnsutil.DNSName(resolver.zone_for_name(fqdn))
|
||||
zone = dnsutil.DNSName(dnsutil.zone_for_name(fqdn))
|
||||
except resolver.NoNameservers:
|
||||
return # if there's no zone, there are no records
|
||||
name = fqdn.relativize(zone)
|
||||
@@ -1227,7 +1227,7 @@ def _ip_ptr_records(ip):
|
||||
"""
|
||||
rname = dnsutil.DNSName(reversename.from_address(ip))
|
||||
try:
|
||||
zone = dnsutil.DNSName(resolver.zone_for_name(rname))
|
||||
zone = dnsutil.DNSName(dnsutil.zone_for_name(rname))
|
||||
name = rname.relativize(zone)
|
||||
result = api.Command['dnsrecord_show'](zone, name)['result']
|
||||
except resolver.NoNameservers:
|
||||
|
||||
Reference in New Issue
Block a user