mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix detection of encoding in zonemgr option
Ticket: https://fedorahosted.org/freeipa/ticket/4762 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
8ef191448f
commit
880f1e5c27
@ -401,13 +401,14 @@ def zonemgr_callback(option, opt_str, value, parser):
|
|||||||
"""
|
"""
|
||||||
Properly validate and convert --zonemgr Option to IA5String
|
Properly validate and convert --zonemgr Option to IA5String
|
||||||
"""
|
"""
|
||||||
# validate the value first
|
if value is not None:
|
||||||
try:
|
# validate the value first
|
||||||
# IDNA support requires unicode
|
try:
|
||||||
value = value.decode(sys.stdin.encoding)
|
# IDNA support requires unicode
|
||||||
validate_zonemgr_str(value)
|
value = value.decode(getattr(sys.stdin, 'encoding', 'utf-8'))
|
||||||
except ValueError, e:
|
validate_zonemgr_str(value)
|
||||||
parser.error("invalid zonemgr: " + unicode(e))
|
except ValueError, e:
|
||||||
|
parser.error("invalid zonemgr: " + unicode(e))
|
||||||
|
|
||||||
parser.values.zonemgr = value
|
parser.values.zonemgr = value
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user