[Freeipa-devel] [PATCH 0171] Fix encoding detection of zonemgr option

2014-11-24 Thread Martin Basti

Ticket: https://fedorahosted.org/freeipa/ticket/4762

Patch attached.

--
Martin Basti

From 2cc99c9140bbe07ed6a4e16037ae036e1f0e2eca Mon Sep 17 00:00:00 2001
From: Martin Basti mba...@redhat.com
Date: Mon, 24 Nov 2014 12:46:37 +0100
Subject: [PATCH] Fix detection of encoding in zonemgr option

Ticket: https://fedorahosted.org/freeipa/ticket/4762
---
 ipaserver/install/bindinstance.py | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 5bf784e62aec7c323a84fc5130e53c3deb86e6fd..f02fe8647dd38d05734311406152c50108077561 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -401,13 +401,14 @@ def zonemgr_callback(option, opt_str, value, parser):
 
 Properly validate and convert --zonemgr Option to IA5String
 
-# validate the value first
-try:
-# IDNA support requires unicode
-value = value.decode(sys.stdin.encoding)
-validate_zonemgr_str(value)
-except ValueError, e:
-parser.error(invalid zonemgr:  + unicode(e))
+if value is not None:
+# validate the value first
+try:
+# IDNA support requires unicode
+value = value.decode(getattr(sys.stdin, 'encoding', 'utf-8'))
+validate_zonemgr_str(value)
+except ValueError, e:
+parser.error(invalid zonemgr:  + unicode(e))
 
 parser.values.zonemgr = value
 
-- 
1.8.3.1

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

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

2014-11-24 Thread Jan Cholasta

Hi,

Dne 24.11.2014 v 14:01 Martin Basti napsal(a):

Ticket: https://fedorahosted.org/freeipa/ticket/4762

Patch attached.


Thanks, ACK.

Pushed to:
master: 230df95ed9e043069da0008d046b6b0135b0a8d1
ipa-4-1: 880f1e5c277a8826e3334723cd840cae4e65dfb8

Honza

--
Jan Cholasta

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