Bump dnspython from 2.2.0 to 2.2.1 (#1679)

* Bump dnspython from 2.2.0 to 2.2.1

Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/rthalley/dnspython/releases)
- [Changelog](https://github.com/rthalley/dnspython/blob/master/doc/whatsnew.rst)
- [Commits](https://github.com/rthalley/dnspython/compare/v2.2.0...v2.2.1)

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

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

* Update dnspython==2.2.1

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-05-16 20:33:29 -07:00 committed by GitHub
parent 54c9214b03
commit aa0c58ef0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 88 additions and 30 deletions

View file

@ -183,6 +183,11 @@ class Zone(dns.transaction.TransactionManager):
"name parameter must be a subdomain of the zone origin")
if self.relativize:
name = name.relativize(self.origin)
elif not self.relativize:
# We have a relative name in a non-relative zone, so derelativize.
if self.origin is None:
raise KeyError('no zone origin is defined')
name = name.derelativize(self.origin)
return name
def __getitem__(self, key):
@ -870,11 +875,20 @@ class Version:
def _validate_name(self, name):
if name.is_absolute():
if not name.is_subdomain(self.zone.origin):
if self.origin is None:
# This should probably never happen as other code (e.g.
# _rr_line) will notice the lack of an origin before us, but
# we check just in case!
raise KeyError('no zone origin is defined')
if not name.is_subdomain(self.origin):
raise KeyError("name is not a subdomain of the zone origin")
if self.zone.relativize:
# XXXRTH should it be an error if self.origin is still None?
name = name.relativize(self.origin)
elif not self.zone.relativize:
# We have a relative name in a non-relative zone, so derelativize.
if self.origin is None:
raise KeyError('no zone origin is defined')
name = name.derelativize(self.origin)
return name
def get_node(self, name):
@ -1030,6 +1044,18 @@ class Transaction(dns.transaction.Transaction):
def _get_node(self, name):
return self.version.get_node(name)
def _origin_information(self):
(absolute, relativize, effective) = self.manager.origin_information()
if absolute is None and self.version.origin is not None:
# No origin has been committed yet, but we've learned one as part of
# this txn. Use it.
absolute = self.version.origin
if relativize:
effective = dns.name.empty
else:
effective = absolute
return (absolute, relativize, effective)
def from_text(text, origin=None, rdclass=dns.rdataclass.IN,
relativize=True, zone_factory=Zone, filename=None,