From dce95a14595a37ce83bcf3e28f41feab715d0c81 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Fri, 2 Sep 2016 16:42:57 +0200 Subject: 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 --- ipaserver/plugins/dns.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ipaserver/plugins/dns.py') diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py index 6f1bd716d..f048351e6 100644 --- a/ipaserver/plugins/dns.py +++ b/ipaserver/plugins/dns.py @@ -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 -- cgit