[Freeipa-devel] [PATCH 0071] Fix - handle python-dns UnicodeError

2014-06-20 Thread Martin Basti
Patch attached
-- 
Martin^2 Basti
From a28ead1232de4cf84c31e942ed2be1ed4ab4a3b3 Mon Sep 17 00:00:00 2001
From: Martin Basti mba...@redhat.com
Date: Fri, 20 Jun 2014 12:53:06 +0200
Subject: [PATCH] Fix handle python-dns UnicodeError

---
 ipapython/dnsutil.py | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ipapython/dnsutil.py b/ipapython/dnsutil.py
index 9c91578a8ccbd5cd30d959e02f23374c47da3fde..3602d22cd1585dd9d6e6546695cb05857a77e865 100644
--- a/ipapython/dnsutil.py
+++ b/ipapython/dnsutil.py
@@ -18,6 +18,7 @@
 #
 
 import dns.name
+import dns.exception
 import copy
 
 
@@ -35,10 +36,10 @@ class DNSName(dns.name.Name):
 labels = labels.labels
 try:
 super(DNSName, self).__init__(labels)
-except UnicodeError:
-#dnspython bug, punycoded label longer than 63 returns UnicodeError
-#instead of LabelTooLong
-raise dns.name.LabelTooLong()
+except UnicodeError, e:
+# dnspython bug, an invalid domain name returns the UnicodeError
+# instead of a dns.exception
+raise dns.exception.SyntaxError(e)
 
 def __nonzero__(self):
 #dns.name.from_text('@') is represented like empty tuple
-- 
1.8.3.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH 0071] Fix - handle python-dns UnicodeError

2014-06-20 Thread Jan Cholasta

On 20.6.2014 13:06, Martin Basti wrote:

Patch attached



ACK.

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH 0071] Fix - handle python-dns UnicodeError

2014-06-20 Thread Martin Kosek
On 06/20/2014 01:28 PM, Jan Cholasta wrote:
 On 20.6.2014 13:06, Martin Basti wrote:
 Patch attached

 
 ACK.
 

Pushed to master: 9f5e77f686a974b837da6eb92cec741fcbb33603

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel