From 2151ab02c19d0a74d90d3784a1ac1b14877a7b96 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Fri, 18 Aug 2017 10:25:51 +0200 Subject: [PATCH] py3: fix caless to CA promotion on replica https://pagure.io/freeipa/issue/4985 Reviewed-By: Fraser Tweedale --- ipaserver/install/ca.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipaserver/install/ca.py b/ipaserver/install/ca.py index c68390e7e..1f295f73a 100644 --- a/ipaserver/install/ca.py +++ b/ipaserver/install/ca.py @@ -54,7 +54,10 @@ external_ca_file = None def subject_validator(valid_attrs, value): - v = unicode(value, 'utf-8') + if not isinstance(value, unicode): + v = unicode(value, 'utf-8') + else: + v = value if any(ord(c) < 0x20 for c in v): raise ValueError("must not contain control characters") if '&' in v: