From 321a2ba9185e4a21d5b2f9949cd3bec32a1fd60a Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Mon, 25 Apr 2016 14:07:16 +0200 Subject: Add ipaDNSVersion option to dnsconfig* commands and use new attribute Ad-hoc LDAP calls in DNS upgrade code were hard to maintain and ipaConfigString was bad idea from the very beginning as it was hard to manipulate the number in it. To avoid problems in future we are introducing new ipaDNSVersion attribute which is used on cn=dns instead of ipaConfigString. Original value of ipaConfigString is kept in the tree for now so older upgraders see it and do not execute the upgrade procedure again. The attribute can be changed only by installer/upgrade so it is not exposed in dnsconfig_mod API. Command dnsconfig_show displays it only if --all option was used. https://fedorahosted.org/freeipa/ticket/5710 Reviewed-By: Martin Basti --- ipalib/plugins/dns.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ipalib') diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 32319dc0f..ef0d9d819 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -4365,6 +4365,9 @@ class dnsconfig(LDAPObject): cli_name='zone_refresh', label=_('Zone refresh interval'), ), + Int('ipadnsversion?', # available only in installer/upgrade + label=_('IPA DNS version'), + ), ) managed_permissions = { 'System: Write DNS Configuration': { @@ -4391,7 +4394,7 @@ class dnsconfig(LDAPObject): 'ipapermdefaultattr': { 'objectclass', 'idnsallowsyncptr', 'idnsforwarders', 'idnsforwardpolicy', - 'idnspersistentsearch', 'idnszonerefresh' + 'idnspersistentsearch', 'idnszonerefresh', 'ipadnsversion' }, 'default_privileges': {'DNS Administrators', 'DNS Servers'}, }, @@ -4412,11 +4415,17 @@ class dnsconfig(LDAPObject): result['summary'] = unicode(_('Global DNS configuration is empty')) - @register() class dnsconfig_mod(LDAPUpdate): __doc__ = _('Modify global DNS configuration.') + def get_options(self): + """hide ipadnsversion outside of installer/upgrade""" + for option in super(dnsconfig_mod, self).get_options(): + if option.name == 'ipadnsversion': + option = option.clone(include=('installer', 'updates')) + yield option + def interactive_prompt_callback(self, kw): # show informative message on client side @@ -4480,6 +4489,7 @@ class dnsconfig_show(LDAPRetrieve): return result + @register() class dnsforwardzone(DNSZoneBase): """ -- cgit