[Python-modules-commits] r12617 - in packages/python-dns/trunk/debian (2 files)
kitterma-guest at users.alioth.debian.org
kitterma-guest at users.alioth.debian.org
Thu Apr 15 00:18:56 UTC 2010
Date: Thursday, April 15, 2010 @ 00:18:48
Author: kitterma-guest
Revision: 12617
* Replace debian/patches/lazy-revlookup.diff with a better patch from
Julian Mehnle - Thanks
Modified:
packages/python-dns/trunk/debian/changelog
packages/python-dns/trunk/debian/patches/lazy-revlookup.diff
Modified: packages/python-dns/trunk/debian/changelog
===================================================================
--- packages/python-dns/trunk/debian/changelog 2010-04-14 21:45:52 UTC (rev 12616)
+++ packages/python-dns/trunk/debian/changelog 2010-04-15 00:18:48 UTC (rev 12617)
@@ -1,3 +1,10 @@
+python-dns (2.3.4-3) unstable; urgency=low
+
+ * Replace debian/patches/lazy-revlookup.diff with a better patch from
+ Julian Mehnle - Thanks
+
+ -- Scott Kitterman <scott at kitterman.com> Wed, 14 Apr 2010 19:23:17 -0400
+
python-dns (2.3.4-2) unstable; urgency=low
* Add debian/patches/lazy-revlookup.diff to fix DNS.revlookup crash when
Modified: packages/python-dns/trunk/debian/patches/lazy-revlookup.diff
===================================================================
--- packages/python-dns/trunk/debian/patches/lazy-revlookup.diff 2010-04-14 21:45:52 UTC (rev 12616)
+++ packages/python-dns/trunk/debian/patches/lazy-revlookup.diff 2010-04-15 00:18:48 UTC (rev 12617)
@@ -1,15 +1,28 @@
-https://sourceforge.net/tracker/index.php?func=detail&aid=2981978&group_id=31674&atid=403047
-
diff -Nur -x '*.orig' -x '*~' python-dns-2.3.4/DNS/lazy.py python-dns-2.3.4.new/DNS/lazy.py
--- python-dns-2.3.4/DNS/lazy.py 2007-05-22 16:23:38.000000000 -0400
-+++ python-dns-2.3.4.new/DNS/lazy.py 2010-04-04 23:27:15.000000000 -0400
-@@ -17,6 +17,9 @@
++++ python-dns-2.3.4.new/DNS/lazy.py 2010-04-14 19:59:56.000000000 -0400
+@@ -10,6 +10,9 @@
+ import Base
+ import string
+
++class NoDataError(IndexError): pass
++class StatusError(IndexError): pass
++
+ def revlookup(name):
+ "convenience routine for doing a reverse lookup of an address"
+ if Base.defaults['server'] == []: Base.DiscoverNameServers()
+@@ -17,7 +20,13 @@
a.reverse()
b = string.join(a, '.')+'.in-addr.arpa'
# this will only return one of any records returned.
-+ status = Base.DnsRequest(b, qtype = 'ptr').req().header['status']
-+ if status != 'NOERROR':
-+ return ("DNS query status: " + status)
- return Base.DnsRequest(b, qtype = 'ptr').req().answers[0]['data']
+- return Base.DnsRequest(b, qtype = 'ptr').req().answers[0]['data']
++ result = Base.DnsRequest(b, qtype = 'ptr').req()
++ if result.header['status'] != 'NOERROR':
++ raise StatusError("DNS query status: %s" % result.header['status'])
++ elif len(result.answers) == 0:
++ raise NoDataError("No PTR records for %s" % name)
++ else:
++ return result.answers[0]['data']
def mxlookup(name):
+ """
More information about the Python-modules-commits
mailing list