1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

dig: remove support for the DLV record as the registry was decomissioned (#4613)

* Remove support for the DLV record as the registry was decomissioned

The DLV registry was decomissioned in 2017 (https://www.isc.org/blogs/dlv/) so it's high time we remove support for DLV records.

* Remove DLV deprecation.

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Jan-Piet Mens 2022-05-23 11:50:39 +02:00 committed by GitHub
parent 4d2bed1dde
commit 511e8e27ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,9 +31,9 @@ DOCUMENTATION = '''
qtype: qtype:
description: description:
- Record type to query. - Record type to query.
- C(DLV) is deprecated and will be removed in community.general 6.0.0. - C(DLV) has been removed in community.general 6.0.0.
default: 'A' default: 'A'
choices: [A, ALL, AAAA, CNAME, DNAME, DLV, DNSKEY, DS, HINFO, LOC, MX, NAPTR, NS, NSEC3PARAM, PTR, RP, RRSIG, SOA, SPF, SRV, SSHFP, TLSA, TXT] choices: [A, ALL, AAAA, CNAME, DNAME, DNSKEY, DS, HINFO, LOC, MX, NAPTR, NS, NSEC3PARAM, PTR, RP, RRSIG, SOA, SPF, SRV, SSHFP, TLSA, TXT]
flat: flat:
description: If 0 each record is returned as a dictionary, otherwise a string. description: If 0 each record is returned as a dictionary, otherwise a string.
default: 1 default: 1
@ -109,9 +109,6 @@ RETURN = """
DNAME: DNAME:
description: description:
- target - target
DLV:
description:
- algorithm, digest_type, key_tag, digest
DNSKEY: DNSKEY:
description: description:
- flags, algorithm, protocol, key - flags, algorithm, protocol, key
@ -174,7 +171,7 @@ try:
import dns.resolver import dns.resolver
import dns.reversename import dns.reversename
import dns.rdataclass import dns.rdataclass
from dns.rdatatype import (A, AAAA, CNAME, DLV, DNAME, DNSKEY, DS, HINFO, LOC, from dns.rdatatype import (A, AAAA, CNAME, DNAME, DNSKEY, DS, HINFO, LOC,
MX, NAPTR, NS, NSEC3PARAM, PTR, RP, SOA, SPF, SRV, SSHFP, TLSA, TXT) MX, NAPTR, NS, NSEC3PARAM, PTR, RP, SOA, SPF, SRV, SSHFP, TLSA, TXT)
HAVE_DNS = True HAVE_DNS = True
except ImportError: except ImportError:
@ -196,7 +193,6 @@ def make_rdata_dict(rdata):
AAAA: ['address'], AAAA: ['address'],
CNAME: ['target'], CNAME: ['target'],
DNAME: ['target'], DNAME: ['target'],
DLV: ['algorithm', 'digest_type', 'key_tag', 'digest'],
DNSKEY: ['flags', 'algorithm', 'protocol', 'key'], DNSKEY: ['flags', 'algorithm', 'protocol', 'key'],
DS: ['algorithm', 'digest_type', 'key_tag', 'digest'], DS: ['algorithm', 'digest_type', 'key_tag', 'digest'],
HINFO: ['cpu', 'os'], HINFO: ['cpu', 'os'],
@ -226,8 +222,6 @@ def make_rdata_dict(rdata):
if isinstance(val, dns.name.Name): if isinstance(val, dns.name.Name):
val = dns.name.Name.to_text(val) val = dns.name.Name.to_text(val)
if rdata.rdtype == DLV and f == 'digest':
val = dns.rdata._hexify(rdata.digest).replace(' ', '')
if rdata.rdtype == DS and f == 'digest': if rdata.rdtype == DS and f == 'digest':
val = dns.rdata._hexify(rdata.digest).replace(' ', '') val = dns.rdata._hexify(rdata.digest).replace(' ', '')
if rdata.rdtype == DNSKEY and f == 'key': if rdata.rdtype == DNSKEY and f == 'key':
@ -332,11 +326,6 @@ class LookupModule(LookupBase):
ret = [] ret = []
if qtype.upper() == 'DLV':
display.deprecated('The DLV record type has been decommissioned in 2017 and support for'
' it will be removed from community.general 6.0.0',
version='6.0.0', collection_name='community.general')
if qtype.upper() == 'PTR': if qtype.upper() == 'PTR':
try: try:
n = dns.reversename.from_address(domain) n = dns.reversename.from_address(domain)