diff options
| author | Bob Halley <halley@dnspython.org> | 2021-12-02 06:43:37 -0800 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2021-12-02 06:43:37 -0800 |
| commit | 73e5671c02490a4e33285d034f35de018d4d7836 (patch) | |
| tree | 109e9a0e3f15570dc7bf29d3ebd2744a6d9615af /dns/node.py | |
| parent | 3b6bc40b11830eb18b56472054bb0e58f9f4072a (diff) | |
| download | dnspython-73e5671c02490a4e33285d034f35de018d4d7836.tar.gz | |
infrastructure needed for CNAME-and-other-data check in txn
Diffstat (limited to 'dns/node.py')
| -rw-r--r-- | dns/node.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dns/node.py b/dns/node.py index 7f172dd..3267de7 100644 --- a/dns/node.py +++ b/dns/node.py @@ -226,3 +226,15 @@ class Node: self.delete_rdataset(replacement.rdclass, replacement.rdtype, replacement.covers) self._append_rdataset(replacement) + + def is_cname(self): + """Is this a CNAME node? + + If the node has a CNAME or an RRSIG(CNAME) it is considered a CNAME + node for CNAME-and-other-data purposes, and ``True`` is returned. + Otherwise the node is an "other data" node, and ``False`` is returned. + """ + for rdataset in self.rdatasets: + if rdataset.implies_cname(): + return True + return False |
