[Freeipa-devel] [PATCH 0172] Fix zonemgr option encoding detection

2014-11-25 Thread Martin Basti

Ticket: https://fedorahosted.org/freeipa/ticket/4766
Patch attached.

--
Martin Basti

From 4ab01f6f91d03aeeb2a1257296815e804f069cad Mon Sep 17 00:00:00 2001
From: Martin Basti mba...@redhat.com
Date: Tue, 25 Nov 2014 14:03:27 +0100
Subject: [PATCH] Fix zonemgr option encoding detection

Ticket: https://fedorahosted.org/freeipa/ticket/4766
---
 ipaserver/install/bindinstance.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index f02fe8647dd38d05734311406152c50108077561..547cf19ee36140b5f29fcf7d217933fa68e1952b 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -405,7 +405,10 @@ def zonemgr_callback(option, opt_str, value, parser):
 # validate the value first
 try:
 # IDNA support requires unicode
-value = value.decode(getattr(sys.stdin, 'encoding', 'utf-8'))
+encoding = getattr(sys.stdin, 'encoding', None)
+if encoding is None:
+encoding = 'utf-8'
+value = value.decode(encoding)
 validate_zonemgr_str(value)
 except ValueError, e:
 parser.error(invalid zonemgr:  + unicode(e))
-- 
1.8.3.1

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

Re: [Freeipa-devel] [PATCH 0172] Fix zonemgr option encoding detection

2014-11-25 Thread Jan Cholasta

Hi,

Dne 25.11.2014 v 14:07 Martin Basti napsal(a):

Ticket: https://fedorahosted.org/freeipa/ticket/4766
Patch attached.



Thanks, ACK. Hopefully it's correct this time.

Pushed to:
master: c13862104ab64cda81c86c51b849c8d01c3c9187
ipa-4-1: e457a3e615b695cfd98e7d54594e5a3663562b06

Honza

--
Jan Cholasta

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


Re: [Freeipa-devel] [PATCH 0172] Fix zonemgr option encoding detection

2014-11-25 Thread Jan Cholasta

Hi,

Dne 25.11.2014 v 14:07 Martin Basti napsal(a):

Ticket: https://fedorahosted.org/freeipa/ticket/4766
Patch attached.



Thanks, ACK. Hopefully it's correct this time.

Pushed to:
master: c13862104ab64cda81c86c51b849c8d01c3c9187
ipa-4-1: e457a3e615b695cfd98e7d54594e5a3663562b06

Honza

--
Jan Cholasta

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