From: Bob Halley Date: Wed, 26 Apr 2006 01:00:14 +0000 (+0000) Subject: add RRset.to_rdataset() X-Git-Tag: v1.4.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e54dffd5b97cd49e7eace75c30d2127b5caae682;p=thirdparty%2Fdnspython.git add RRset.to_rdataset() --- diff --git a/ChangeLog b/ChangeLog index 746f2964..ddc3844e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-25 Bob Halley + + * dns/rrset.py (RRset.to_rdataset): Added a convenience method + to convert an rrset into an rdataset. + 2006-03-27 Bob Halley * Added dns.e164.query(). This function can be used to look for diff --git a/dns/rrset.py b/dns/rrset.py index f9b87367..185ec6e2 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