summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2006-04-26 01:00:14 +0000
committerBob Halley <halley@dnspython.org>2006-04-26 01:00:14 +0000
commite54dffd5b97cd49e7eace75c30d2127b5caae682 (patch)
treea96707ec3999080c9ce624b72cf04680834a4a09
parentd428c45191faee0e0c64f1076e5d632fe0c0c1e5 (diff)
downloaddnspython-e54dffd5b97cd49e7eace75c30d2127b5caae682.tar.gz
add RRset.to_rdataset()
-rw-r--r--ChangeLog5
-rw-r--r--dns/rrset.py7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 746f296..ddc3844 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-25 Bob Halley <halley@nominum.com>
+
+ * dns/rrset.py (RRset.to_rdataset): Added a convenience method
+ to convert an rrset into an rdataset.
+
2006-03-27 Bob Halley <halley@dnspython.org>
* Added dns.e164.query(). This function can be used to look for
diff --git a/dns/rrset.py b/dns/rrset.py
index f9b8736..185ec6e 100644
--- a/dns/rrset.py
+++ b/dns/rrset.py
@@ -107,6 +107,13 @@ class RRset(dns.rdataset.Rdataset):
return super(RRset, self).to_wire(self.name, file, compress, origin,
self.deleting, **kw)
+ def to_rdataset(self):
+ """Convert an RRset into an Rdataset.
+
+ #rtype: dns.rdataset.Rdataset object
+ """
+ return dns.rdataset.from_rdata_list(self.ttl, list(self))
+
def from_text_list(name, ttl, rdclass, rdtype, text_rdatas):
"""Create an RRset with the specified name, TTL, class, and type, and with