Bump dnspython from 2.0.0 to 2.2.0 (#1618)

* Bump dnspython from 2.0.0 to 2.2.0

Bumps [dnspython]() from 2.0.0 to 2.2.0.

---
updated-dependencies:
- dependency-name: dnspython
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update dnspython==2.2.0

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2022-01-25 11:08:24 -08:00 committed by GitHub
parent 515a5d42d3
commit 3c93b5600f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
143 changed files with 7498 additions and 2054 deletions

View file

@ -69,25 +69,45 @@ class RRset(dns.rdataset.Rdataset):
return self.to_text()
def __eq__(self, other):
if not isinstance(other, RRset):
return False
if self.name != other.name:
if isinstance(other, RRset):
if self.name != other.name:
return False
elif not isinstance(other, dns.rdataset.Rdataset):
return False
return super().__eq__(other)
def match(self, name, rdclass, rdtype, covers, deleting=None):
"""Returns ``True`` if this rrset matches the specified class, type,
covers, and deletion state.
"""
def match(self, *args, **kwargs):
"""Does this rrset match the specified attributes?
Behaves as :py:func:`full_match()` if the first argument is a
``dns.name.Name``, and as :py:func:`dns.rdataset.Rdataset.match()`
otherwise.
(This behavior fixes a design mistake where the signature of this
method became incompatible with that of its superclass. The fix
makes RRsets matchable as Rdatasets while preserving backwards
compatibility.)
"""
if isinstance(args[0], dns.name.Name):
return self.full_match(*args, **kwargs)
else:
return super().match(*args, **kwargs)
def full_match(self, name, rdclass, rdtype, covers,
deleting=None):
"""Returns ``True`` if this rrset matches the specified name, class,
type, covers, and deletion state.
"""
if not super().match(rdclass, rdtype, covers):
return False
if self.name != name or self.deleting != deleting:
return False
return True
# pylint: disable=arguments-differ
def to_text(self, origin=None, relativize=True, **kw):
"""Convert the RRset into DNS master file format.
"""Convert the RRset into DNS zone file format.
See ``dns.name.Name.choose_relativity`` for more information
on how *origin* and *relativize* determine the way names
@ -106,7 +126,8 @@ class RRset(dns.rdataset.Rdataset):
return super().to_text(self.name, origin, relativize,
self.deleting, **kw)
def to_wire(self, file, compress=None, origin=None, **kw):
def to_wire(self, file, compress=None, origin=None,
**kw):
"""Convert the RRset to wire format.
All keyword arguments are passed to ``dns.rdataset.to_wire()``; see
@ -118,6 +139,8 @@ class RRset(dns.rdataset.Rdataset):
return super().to_wire(self.name, file, compress, origin,
self.deleting, **kw)
# pylint: enable=arguments-differ
def to_rdataset(self):
"""Convert an RRset into an Rdataset.
@ -127,7 +150,8 @@ class RRset(dns.rdataset.Rdataset):
def from_text_list(name, ttl, rdclass, rdtype, text_rdatas,
idna_codec=None):
idna_codec=None, origin=None, relativize=True,
relativize_to=None):
"""Create an RRset with the specified name, TTL, class, and type, and with
the specified list of rdatas in text format.
@ -135,6 +159,14 @@ def from_text_list(name, ttl, rdclass, rdtype, text_rdatas,
encoder/decoder to use; if ``None``, the default IDNA 2003
encoder/decoder is used.
*origin*, a ``dns.name.Name`` (or ``None``), the
origin to use for relative names.
*relativize*, a ``bool``. If true, name will be relativized.
*relativize_to*, a ``dns.name.Name`` (or ``None``), the origin to use
when relativizing names. If not set, the *origin* value will be used.
Returns a ``dns.rrset.RRset`` object.
"""
@ -145,7 +177,8 @@ def from_text_list(name, ttl, rdclass, rdtype, text_rdatas,
r = RRset(name, rdclass, rdtype)
r.update_ttl(ttl)
for t in text_rdatas:
rd = dns.rdata.from_text(r.rdclass, r.rdtype, t, idna_codec=idna_codec)
rd = dns.rdata.from_text(r.rdclass, r.rdtype, t, origin, relativize,
relativize_to, idna_codec)
r.add(rd)
return r