summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-04-25 14:07:16 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-30 20:14:32 +0200
commit321a2ba9185e4a21d5b2f9949cd3bec32a1fd60a (patch)
tree1d826eb5b4b21e9562d49536b556d037dbb64ee7 /ipalib
parent70794c7b1d001ce331d4a64c77d23abcc02c541e (diff)
downloadfreeipa-321a2ba9185e4a21d5b2f9949cd3bec32a1fd60a.tar.gz
freeipa-321a2ba9185e4a21d5b2f9949cd3bec32a1fd60a.tar.xz
freeipa-321a2ba9185e4a21d5b2f9949cd3bec32a1fd60a.zip
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 <mbasti@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/dns.py14
1 files changed, 12 insertions, 2 deletions
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):
"""