From c3f390d2264f71cf4b87123fdcabd007075704ab Mon Sep 17 00:00:00 2001 From: Aleksei Slaikovskii Date: Oct 18 2017 11:24:47 +0000 Subject: ipaclient.plugins.dns: Cast DNS name to unicode. cmd.api.Command.dnsrecord_split_parts expects name to be unicode string and instead gets ascii. It leads to an error: ipa: ERROR: invalid 'name': must be Unicode text This commit's change is casting name's type to unicode so 'ipa dnsrecord-mod' will not fail with error above. https://pagure.io/freeipa/issue/7185 Reviewed-By: Tibor Dudlak Reviewed-By: Stanislav Laznicka --- diff --git a/ipaclient/plugins/dns.py b/ipaclient/plugins/dns.py index f671897..fdbbdef 100644 --- a/ipaclient/plugins/dns.py +++ b/ipaclient/plugins/dns.py @@ -62,7 +62,7 @@ def __get_part_param(rrtype, cmd, part, output_kw, default=None): def prompt_parts(rrtype, cmd, mod_dnsvalue=None): mod_parts = None if mod_dnsvalue is not None: - name = record_name_format % rrtype.lower() + name = record_name_format % unicode(rrtype.lower()) mod_parts = cmd.api.Command.dnsrecord_split_parts( name, mod_dnsvalue)['result']