From 9b562f7377e2efe26742740108a398f4ebb3df64 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Wed, 7 Mar 2012 15:54:38 +0100 Subject: [PATCH] Add missing global options in dnsconfig Add a support for new global options in bind-dyndb-ldap, that is: * idnsforwardpolicy: Default policy for conditional forwarding * idnsallowsyncptr: Allow globaly PTR synchronization for dynamic updates * idnszonerefresh: Default interval between regular polls of the name server for new DNS zones https://fedorahosted.org/freeipa/ticket/2439 --- API.txt | 5 ++++- VERSION | 2 +- ipalib/plugins/dns.py | 21 ++++++++++++++++++++- tests/test_xmlrpc/test_dns_plugin.py | 6 +++++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/API.txt b/API.txt index f21dce7a8..363ba5a5e 100644 --- a/API.txt +++ b/API.txt @@ -611,8 +611,11 @@ output: Output('summary', (, ), None) output: Output('result', , None) output: Output('value', , None) command: dnsconfig_mod -args: 0,8,3 +args: 0,11,3 option: Str('idnsforwarders', attribute=True, autofill=False, cli_name='forwarder', csv=True, multivalue=True, required=False) +option: StrEnum('idnsforwardpolicy', attribute=True, autofill=False, cli_name='forward_policy', multivalue=False, required=False, values=(u'only', u'first')) +option: Bool('idnsallowsyncptr', attribute=True, autofill=False, cli_name='allow_sync_ptr', multivalue=False, required=False) +option: Int('idnszonerefresh', attribute=True, autofill=False, cli_name='zone_refresh', minvalue=0, multivalue=False, required=False) option: Str('setattr*', cli_name='setattr', exclude='webui') option: Str('addattr*', cli_name='addattr', exclude='webui') option: Str('delattr*', cli_name='delattr', exclude='webui') diff --git a/VERSION b/VERSION index 51870e708..f26e8bfa8 100644 --- a/VERSION +++ b/VERSION @@ -79,4 +79,4 @@ IPA_DATA_VERSION=20100614120000 # # ######################################################## IPA_API_VERSION_MAJOR=2 -IPA_API_VERSION_MINOR=30 +IPA_API_VERSION_MINOR=31 diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 251db476e..a1d495449 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -2640,7 +2640,10 @@ class dnsconfig(LDAPObject): DNS global configuration object """ object_name = _('DNS configuration options') - default_attributes = [ 'idnsforwarders', ] + default_attributes = [ + 'idnsforwardpolicy', 'idnsforwarders', 'idnsallowsyncptr', + 'idnszonerefresh' + ] label = _('DNS Global Configuration') label_singular = _('DNS Global Configuration') @@ -2654,6 +2657,22 @@ class dnsconfig(LDAPObject): 'for each forwarder using a standard format "IP_ADDRESS port PORT"'), csv=True, ), + StrEnum('idnsforwardpolicy?', + cli_name='forward_policy', + label=_('Forward policy'), + values=(u'only', u'first',), + ), + Bool('idnsallowsyncptr?', + cli_name='allow_sync_ptr', + label=_('Allow PTR sync'), + doc=_('Allow synchronization of forward (A, AAAA) and reverse (PTR) records'), + ), + Int('idnszonerefresh?', + cli_name='zone_refresh', + label=_('Zone refresh interval'), + doc=_('An interval between regular polls of the name server for new DNS zones'), + minvalue=0, + ), ) def get_dn(self, *keys, **kwargs): diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py index e3958d23f..e310d3194 100644 --- a/tests/test_xmlrpc/test_dns_plugin.py +++ b/tests/test_xmlrpc/test_dns_plugin.py @@ -66,7 +66,11 @@ class test_dns(Declarative): ('dnsrecord_del', [dnszone1, dnsres1], {'del_all' : True}), ('dnszone_del', [dnszone2], {}), ('dnszone_del', [revdnszone1], {}), - ('dnsconfig_mod', [], {'idnsforwarders' : None,}) + ('dnsconfig_mod', [], {'idnsforwarders' : None, + 'idnsforwardpolicy' : None, + 'idnsallowsyncptr' : None, + 'idnszonerefresh' : None, + }) ] tests = [