dns: do not rely on custom param fields in record attributes

Obtain the information provided by the `hint` kwarg and `dnsrecord_part`
and `dnsrecord_extra` flags by other means.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-04-28 10:32:00 +02:00
parent ade8d42525
commit 234270dc75
3 changed files with 46 additions and 29 deletions

View File

@@ -25,7 +25,8 @@ import copy
from ipaclient.frontend import MethodOverride, CommandOverride
from ipalib import errors
from ipalib.dns import (get_record_rrtype,
from ipalib.dns import (get_part_rrtype,
get_record_rrtype,
has_cli_options,
iterate_rrparams_by_parts,
record_name_format)
@@ -63,7 +64,7 @@ def prompt_parts(rrtype, cmd, mod_dnsvalue=None):
name, mod_dnsvalue)['result']
user_options = {}
parts = [p for p in cmd.params() if 'dnsrecord_part' in p.flags]
parts = [p for p in cmd.params() if get_part_rrtype(p.name) == rrtype]
if not parts:
return user_options
@@ -80,7 +81,7 @@ def prompt_parts(rrtype, cmd, mod_dnsvalue=None):
def prompt_missing_parts(rrtype, cmd, kw, prompt_optional=False):
user_options = {}
parts = [p for p in cmd.params() if 'dnsrecord_part' in p.flags]
parts = [p for p in cmd.params() if get_part_rrtype(p.name) == rrtype]
if not parts:
return user_options