dns: prompt for missing record parts in CLI

Fix the code which determines if a record part is required and thus should
be prompted not to wrongfully consider all record parts to be optional.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta
2016-09-02 16:42:57 +02:00
committed by Martin Basti
parent afea961631
commit dce95a1459
4 changed files with 62 additions and 16 deletions

View File

@@ -3471,6 +3471,21 @@ class dnsrecord(LDAPObject):
)
# Make DNS record types available as objects in the API.
# This is used by the CLI to get otherwise unavailable attributes of record
# parts.
for param in _dns_records:
register()(
type(
'dns{}record'.format(param.rrtype.lower()),
(Object,),
dict(
takes_params=(param.parts or ()) + (param.extra or ()),
)
)
)
@register()
class dnsrecord_split_parts(Command):
NO_CLI = True