Skip to content

Commit

Permalink
Update for dnspython 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kalou committed Jun 4, 2021
1 parent e7fcd62 commit 5667348
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dnsknife/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def query_with_default_name(name='', text=False):
return query_with_default_name

def __getattribute__(self, name):
if name in dns.rdatatype._by_text.keys():
if name in dns.rdatatype.RdataType.__members__:
return self.partial_query(name)
return super(TypeAware, self).__getattribute__(name)

Expand Down
3 changes: 1 addition & 2 deletions dnsknife/dnssec.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,4 @@ def matching_key(dnskeys, ds):
candidate = dns.dnssec.make_ds(dnskeys.name, k, dtype)
if candidate.digest == ds.digest:
# Special case for CDS alg 0
k.algorithm = ds.algorithm
return k
return k.replace(algorithm=ds.algorithm)
25 changes: 0 additions & 25 deletions dnsknife/monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,6 @@
import dns.rdtypes.ANY.DS
import dns.rdtypes.ANY.DNSKEY

dns.rdatatype.CDS = 59
dns.rdatatype._by_text['CDS'] = dns.rdatatype.CDS
dns.rdatatype._by_value[59] = 'CDS'

dns.rdatatype.CDNSKEY = 60
dns.rdatatype._by_text['CDNSKEY'] = dns.rdatatype.CDNSKEY
dns.rdatatype._by_value[60] = 'CDNSKEY'

dns.rdata._rdata_modules[(dns.rdataclass.IN,
dns.rdatatype.CDS)] = dns.rdtypes.ANY.DS
dns.rdtypes.ANY.DS.CDS = dns.rdtypes.ANY.DS.DS

dns.rdata._rdata_modules[(dns.rdataclass.IN,
dns.rdatatype.CDNSKEY)] = dns.rdtypes.ANY.DNSKEY
dns.rdtypes.ANY.DNSKEY.CDNSKEY = dns.rdtypes.ANY.DNSKEY.DNSKEY

if not hasattr(dns.rdatatype, 'URI'):
dns.rdatatype.URI = 256
dns.rdatatype._by_text['URI'] = dns.rdatatype.URI
dns.rdata.GenericRdata.target = property(lambda x: x.data[4:])

# For pickle/unpickle

del dns.name.Name.__setattr__

# Select.poll is not always available

class Poll:
Expand Down

0 comments on commit 5667348

Please sign in to comment.