URL: https://github.com/freeipa/freeipa/pull/923
Author: felipevolpone
 Title: #923: py3: fixing zonemgr_callback
Action: opened

PR body:
"""
Previously, `zonemgr_callback` was expecting unicode, but getting bytes.

https://pagure.io/freeipa/issue/5990
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/923/head:pr923
git checkout pr923
From c30f1988a133ec8116433699ab988576a614e9a9 Mon Sep 17 00:00:00 2001
From: Felipe Volpone <fbarr...@redhat.com>
Date: Tue, 18 Jul 2017 14:55:43 -0300
Subject: [PATCH] py3: fixing zonemgr_callback

Previously, zonemgr_callback was expecting unicode,
but getting bytes.

https://pagure.io/freeipa/issue/5990
---
 ipalib/util.py                    | 2 +-
 ipaserver/install/bindinstance.py | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/ipalib/util.py b/ipalib/util.py
index 880d2bc218..16d90aee02 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -379,7 +379,7 @@ def validate_domain_name(domain_name, allow_underscore=False, allow_slash=False)
 
 def validate_zonemgr(zonemgr):
     assert isinstance(zonemgr, DNSName)
-    if any('@' in label for label in zonemgr.labels):
+    if any(b'@' in label for label in zonemgr.labels):
         raise ValueError(_('too many \'@\' characters'))
 
 
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 12d4a01ab4..02a4208c66 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -423,7 +423,6 @@ def zonemgr_callback(option, opt_str, value, parser):
             encoding = getattr(sys.stdin, 'encoding', None)
             if encoding is None:
                 encoding = 'utf-8'
-            value = value.decode(encoding)
             validate_zonemgr_str(value)
         except ValueError as e:
             # FIXME we can do this in better way
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to