VMM/handler: Improved domaininfo subcommand.
authorPascal Volk <user@localhost.localdomain.org>
Mon, 27 Jan 2014 21:27:21 +0000
changeset 702 01db2457bbed
parent 701 110491a871a7
child 703 58815c004a61
VMM/handler: Improved domaininfo subcommand. Check all labels for ASCII-compatible encoding, not only the first one. If something is in ACE format, convert it to IDNA.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Sun Jan 26 16:13:00 2014 +0000
+++ b/VirtualMailManager/handler.py	Mon Jan 27 21:27:21 2014 +0000
@@ -522,7 +522,8 @@
                            INVALID_ARGUMENT)
         dom = self._get_domain(domainname)
         dominfo = dom.get_info()
-        if dominfo['domain name'].startswith('xn--'):
+        if dominfo['domain name'].startswith('xn--') or \
+           dominfo['domain name'].count('.xn--'):
             dominfo['domain name'] += ' (%s)' % \
                                       dominfo['domain name'].decode('idna')
         if details is None: