summaryrefslogtreecommitdiff
path: root/dns/zone.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix #698 and #702, problems caused by _cmp() giving the wrongBob Halley2021-10-111-4/+5
| | | | | result in certain comparisons of rdata with relative and absolute names.
* Add want_origin parameter to zone to_text() and to_file().Bob Halley2021-06-131-3/+22
| | | | [Issue #654]
* Lint passBob Halley2021-05-021-1/+1
|
* Add custome exceptions.Brian Wellington2021-02-251-4/+24
|
* Add more tests.Brian Wellington2021-02-251-1/+10
| | | | zone.compute_digest() didn't actually work. It does now.
* Checkpoint ZONEMD support.Brian Wellington2021-02-241-0/+77
|
* make `name in zone` consistent with `zone[name]`kimbo2021-02-161-2/+3
| | | | | specifically, allow name to be a str, and raise a KeyError if name cannot be converted into a dns.name.Name
* add effective origin to origin_information()Bob Halley2020-08-201-1/+7
|
* Txns and txn managers have a single RdataClassBob Halley2020-08-191-11/+5
|
* rename masterfile to zonefileBob Halley2020-08-191-10/+10
|
* store reference to manager in all txns; add origin_information()Bob Halley2020-08-181-6/+12
|
* Allow explicit commit/rollback. Prevent multiple txn end. Add txn.changed().Bob Halley2020-08-131-1/+7
|
* Transaction support.Bob Halley2020-08-101-412/+113
|
* pylint lintingBob Halley2020-07-311-2/+4
|
* to_text() always returns a str, so no need to check if it is not a strBob Halley2020-07-241-5/+1
|
* a way of doing commentscommentsBob Halley2020-07-201-4/+15
|
* simplify TTL check when reading a zone fileBob Halley2020-06-171-10/+7
|
* remove unneeded exception catching from rhs setting in $GENERATE code ↵Bob Halley2020-06-171-5/+2
| | | | (cut-and-paste issue)
* Minor Python 3 cleanups.Brian Wellington2020-06-031-2/+2
| | | | | | | Classes inherit from object by default; there's no need to explicitly include this. Replace super(Foo, self) with super().
* Remove dns.rdata{type,class}.to_enum.Brian Wellington2020-05-211-10/+10
| | | | | | | These methods (which convert a str/int into an enum/int) shouldn't be commonly used by external code, so don't need to exist at the module level. The make() method on the enum class (renamed from to_enum()) can still be used, and the internal callers have been updated to use it.
* Simplify exception handling.Brian Wellington2020-05-201-6/+6
|
* Start converting rdatatype/rdataclass to enum.Brian Wellington2020-05-181-20/+15
|
* flake8 lintingBob Halley2020-05-151-20/+12
|
* Fix documentation typos.Brian Wellington2020-05-111-1/+1
|
* more documentationBob Halley2020-05-091-229/+341
|
* IDNA support for zones, messages, names in rdata, rrsets, and rdatasets.Bob Halley2020-05-031-6/+10
|
* Use context managers to simplify code.Brian Wellington2020-05-011-41/+27
| | | | | | | | Simplify code using try/finally to use context managers. In some cases, contextlib.ExitStack() is used; this could probably be further simplified to use contextlib.nullcontext() once Python 3.7+ is a requirement.
* In library code, replace from io import BytesIO (or StringIO) with import ioBob Halley2020-05-011-4/+4
|
* Remove "from __future__ import" statements.Brian Wellington2020-05-011-2/+0
| | | | None of these are needed anymore.
* Merge pull request #431 from bwelling/zone-to-textBob Halley2020-03-201-2/+2
|\ | | | | zone.to_text() should return a string.
| * zone.to_text() should return a string.Brian Wellington2020-03-201-2/+2
| | | | | | | | | | | | As part of the Python 3 conversion, the result of dns.zone.to_text() changed from str to bytes. This was likely unintentional, as a method with text in its name should be returning text.
* | Add relativize_to to from_text().Brian Wellington2020-03-181-4/+4
|/ | | | | | | | | | | | | | | When calling from_text, the zone code needs to apply the current origin (which may or may not be the zone origin, if sub-zone $ORIGIN statements are present), and may also want to relativize the contents to the zone origin. Previously, this was done by explicitly reading records as absolute, and then relativizing them laster. With this change, the work is moved to the tokenizer. This gets rid of the remaining internal uses of dns.rdata.choose_relativity(), which prevents rdata from being immutable.
* Remove choose_relativity() from zone.from_xfr()Brian Wellington2020-03-181-1/+0
| | | | | | | | | | The comment states that relativize must be consistent between dns.query.xfr() and dns.zone.from_xfr(), and the code fails if they're not (if check_origin is True, at least). This means that the rdata is already correctly relativized (or not). This also adds a test of creating zones from xfrs, both relativized and not.
* MNT: use raw string literals for invalid escapesThomas A Caswell2019-10-301-3/+3
|
* Update zone.pytmerila2019-04-031-3/+3
| | | Check for self.last_ttl_known before setting ttl = self.last_ttl so it will remain None instead of 0 if value is not known.
* Update zone.pytmerila2019-04-031-1/+1
| | | Need to also check that last TTL is known before using it as a fallback, otherwise ttl is never None in the last check, setting it incorrectly to 0 instead.
* Update zone.pytmerila2019-04-031-12/+21
| | | Instead of moving the entire TTL parsing past the rdata handling (causing the RR to be parsed on the wrong way), returned the parsing to its original location, and only moved the final failure code past the rdata handling.
* Update zone.pytmerila2019-04-031-15/+17
| | | By doing the TTL validity check after parsing the record data allows the TTL to be set properly from SOA RDATA even when the SOA record itself does not have TTL set.
* $GENERATE was not padding correctly given a pattern like ${0,3} it wasBob Halley2019-02-211-1/+0
| | | | | using the index field (0) as the padding width, instead of the correct value 3.
* Fix exception when parsing certain generate statementsSigmund Augdal2019-02-211-2/+2
|
* remove the rest of the unicode string prefixesBob Halley2019-01-081-12/+12
|
* Remove _compat module.Bob Halley2018-12-091-33/+20
|
* delintBob Halley2018-12-011-3/+3
|
* update copyrightBob Halley2018-12-011-0/+2
|
* Upgrade Python syntax with pyupgrade https://github.com/asottile/pyupgradeHugo2018-09-061-1/+1
|
* Initial type signaturesJanus2018-07-311-2/+2
|
* Merge pull request #255 from tomlanyon/masterBob Halley2018-07-171-10/+48
|\ | | | | Improve TTL detection when reading master zone files.
| * Improve TTL detection when reading master zone files.Tom Lanyon2017-05-311-10/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the same behaviour that BIND has when it encounters implicit TTL values, namely: * The $TTL directive is preferred to set the default TTL [RFC2308]. * If no $TTL directive is seen prior to the SOA RR, the default TTL is set to the minimum TTL field of the SOA RR [RFC1033, RFC1035, RFC1912]. * If neither $TTL nor an SOA are present, use the last seen explicit TTL on an RR or raise a SyntaxError if no explicit TTLs have been seen. Previously, when neither $TTL nor SOA were present, the TTL for an RR without an explicit TTL would be set to 0 which is known to be a somewhat dangerous value and shouldn't be encouraged as a default. One test seems to rely on this default TTL=0 behaviour whilst testing something seemingly unrelated (RR starting with whitespace), so that test has been updated to match this new expectation. Fixes #254.
* | the universal newlines fix was backwardsBob Halley2018-02-211-2/+2
| |
* | Remove deprecated U option to open on python 3.Bob Halley2018-02-201-1/+4
| | | | | | | | [Issue #252]