]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
add RRset.to_rdataset()
authorBob Halley <halley@dnspython.org>
Wed, 26 Apr 2006 01:00:14 +0000 (01:00 +0000)
committerBob Halley <halley@dnspython.org>
Wed, 26 Apr 2006 01:00:14 +0000 (01:00 +0000)
ChangeLog
dns/rrset.py

index 746f296424df57bc73596321ba832b2ff4583a8a..ddc3844e63511c3d37b1cbdffe8d86280782bb88 100644 (file)
--- 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
index f9b873675899b16bc3943f396f84e534fb282e6e..185ec6e2ceaffbfe37a82e77954c68c327717d1d 100644 (file)
@@ -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