summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2021-12-03 11:39:50 -0800
committerBob Halley <halley@dnspython.org>2021-12-03 11:39:50 -0800
commitc46a91d5926e7ddaa32a466572c4b87dea46aa69 (patch)
treea5dc06ed4c78470b170dcde66d254c6f1261060e /dns
parentc34af7dfaa56982b8be1ea5203f39b93288ae9d6 (diff)
downloaddnspython-c46a91d5926e7ddaa32a466572c4b87dea46aa69.tar.gz
fix typos; simplify _check_cname_and_other_data
Diffstat (limited to 'dns')
-rw-r--r--dns/node.py6
-rw-r--r--dns/zonefile.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/dns/node.py b/dns/node.py
index b3f5785..63ce008 100644
--- a/dns/node.py
+++ b/dns/node.py
@@ -69,8 +69,8 @@ class Node:
"""A Node is a set of rdatasets.
A node is either a CNAME node or an "other data" node. A CNAME
- node contains only CNAME, KEY, RRSIG(CNAME), NSEC, RRSIG(NSEC), NSEC3,
- or RRSIG(NSEC3) rdatasets. An "other data" node contains any
+ node contains only CNAME, KEY, NSEC, and NSEC3 rdatasets along with their
+ covering RRSIG rdatasets. An "other data" node contains any
rdataset other than a CNAME or RRSIG(CNAME) rdataset. When
changes are made to a node, the CNAME or "other data" state is
always consistent with the update, i.e. the most recent change
@@ -138,7 +138,7 @@ class Node:
Specifically, if the rdataset being appended has ``NodeKind.CNAME``,
then all rdatasets other than KEY, NSEC, NSEC3, and their covering
RRSIGs are deleted. If the rdataset being appended has
- ``NodeKind.REGUALAR`` then CNAME and RRSIG(CNAME) are deleted.
+ ``NodeKind.REGULAR`` then CNAME and RRSIG(CNAME) are deleted.
"""
# Make having just one rdataset at the node fast.
if len(self.rdatasets) > 0:
diff --git a/dns/zonefile.py b/dns/zonefile.py
index bcafe1d..ce16abb 100644
--- a/dns/zonefile.py
+++ b/dns/zonefile.py
@@ -45,10 +45,10 @@ class CNAMEAndOtherData(dns.exception.DNSException):
def _check_cname_and_other_data(txn, name, rdataset):
rdataset_kind = dns.node.NodeKind.classify_rdataset(rdataset)
node = txn.get_node(name)
- if node is not None:
- node_kind = node.classify()
- else:
- node_kind = dns.node.NodeKind.NEUTRAL
+ if node is None:
+ # empty nodes are neutral.
+ return
+ node_kind = node.classify()
if node_kind == dns.node.NodeKind.CNAME and \
rdataset_kind == dns.node.NodeKind.REGULAR:
raise CNAMEAndOtherData('rdataset type is not compatible with a '