diff --git a/API.txt b/API.txt index 1c8600930..2e968d872 100644 --- a/API.txt +++ b/API.txt @@ -1092,10 +1092,12 @@ output: Output('result', type=[]) output: Output('summary', type=[, ]) output: Output('value', type=[]) command: dns_update_system_records -args: 0,2,2 +args: 0,4,2 +option: Flag('all', autofill=True, cli_name='all', default=False) option: Flag('dry_run', autofill=True, default=False) +option: Flag('raw', autofill=True, cli_name='raw', default=False) option: Str('version?') -output: Output('result', type=[]) +output: Entry('result') output: Output('value', type=[]) command: dnsconfig_mod args: 0,11,3 diff --git a/VERSION b/VERSION index b4c414bbe..a979d378d 100644 --- a/VERSION +++ b/VERSION @@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000 # # ######################################################## IPA_API_VERSION_MAJOR=2 -IPA_API_VERSION_MINOR=197 -# Last change: pspacek - DNS: Support default TTL setting for master DNS zones +IPA_API_VERSION_MINOR=198 +# Last change: dns: fix dns_update_system_records to work with thin client diff --git a/ipaclient/plugins/dns.py b/ipaclient/plugins/dns.py index d04f686dd..bca5ad73c 100644 --- a/ipaclient/plugins/dns.py +++ b/ipaclient/plugins/dns.py @@ -23,7 +23,7 @@ from __future__ import print_function import six import copy -from ipaclient.frontend import MethodOverride, CommandOverride +from ipaclient.frontend import MethodOverride from ipalib import errors from ipalib.dns import (get_part_rrtype, get_record_rrtype, @@ -347,7 +347,7 @@ class dnsforwardzone_mod(MethodOverride): @register(override=True) -class dns_update_system_records(CommandOverride): +class dns_update_system_records(MethodOverride): def output_for_cli(self, textui, output, *args, **options): output_super = copy.deepcopy(output) super_res = output_super.get('result', {}) diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py index eab6afc57..5c7ce51d4 100644 --- a/ipaserver/plugins/dns.py +++ b/ipaserver/plugins/dns.py @@ -41,6 +41,7 @@ from ipalib.dns import (extra_name_format, iterate_rrparams_by_parts, part_name_format, record_name_format) +from ipalib.frontend import Method, Object from ipalib.request import context from ipalib import api, errors, output from ipalib import Command @@ -4428,11 +4429,8 @@ class dnsforwardzone_remove_permission(DNSZoneBase_remove_permission): @register() -class dns_update_system_records(Command): - __doc__ = _('Update location and IPA server DNS records') - - - has_output_params = ( +class dns_system_records(Object): + takes_params = ( Str( 'ipa_records*', label=_('IPA DNS records') @@ -4443,11 +4441,17 @@ class dns_update_system_records(Command): ) ) + +@register() +class dns_update_system_records(Method): + __doc__ = _('Update location and IPA server DNS records') + + obj_name = 'dns_system_records' + attr_name = 'update' + has_output = ( - output.Output( + output.Entry( 'result', - type=dict, - doc=_('Dictionary mapping variable name to value'), ), output.Output( 'value', bool,