CLI conversion of DNSName type

Part of ticket:
IPA should allow internationalized domain names
https://fedorahosted.org/freeipa/ticket/3169

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti 2014-03-27 15:04:58 +01:00 committed by Martin Kosek
parent d0cf1f3e94
commit b9969c6afe

View File

@ -51,6 +51,7 @@ from constants import CLI_TAB, LDAP_GENERALIZED_TIME_FORMAT
from parameters import File, Str, Enum, Any
from text import _
from ipapython.version import API_VERSION
from ipapython.dnsutil import DNSName
import datetime
@ -160,6 +161,8 @@ class textui(backend.Backend):
return base64.b64encode(value)
elif type(value) is datetime.datetime:
return value.strftime(LDAP_GENERALIZED_TIME_FORMAT)
elif isinstance(value, DNSName):
return unicode(value)
else:
return value