summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/dns.py
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-05-30 18:42:01 +0200
committerMartin Basti <mbasti@redhat.com>2016-06-13 17:50:54 +0200
commit5f7086e7183f0fcfece2bdd5be3d1ea17384717b (patch)
tree27dab7bd3dae33d40c160f208db09d3d3ad54c6b /ipaserver/plugins/dns.py
parentb9aa31191b3067aced1432daa06d18b4382cd77f (diff)
downloadfreeipa-5f7086e7183f0fcfece2bdd5be3d1ea17384717b.tar.gz
freeipa-5f7086e7183f0fcfece2bdd5be3d1ea17384717b.tar.xz
freeipa-5f7086e7183f0fcfece2bdd5be3d1ea17384717b.zip
Server Roles: make *config-show consume relevant roles/attributes
This patch modifies config objects so that the roles/attributes relevant to the configuration are shown in the output: * config-{show,mod} will show list of all IPA masters, CA servers and CA renewal master * dnsconfig-{show,mod} will list all DNS server and DNS key master * trustconfig-{show,mod} will list all AD trust controllers and agents * vaultconfig-show will list all Key Recovery Agents http://www.freeipa.org/page/V4/Server_Roles https://fedorahosted.org/freeipa/ticket/5181 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
Diffstat (limited to 'ipaserver/plugins/dns.py')
-rw-r--r--ipaserver/plugins/dns.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py
index 9cca07c6d..db1790793 100644
--- a/ipaserver/plugins/dns.py
+++ b/ipaserver/plugins/dns.py
@@ -4064,6 +4064,18 @@ class dnsconfig(LDAPObject):
Int('ipadnsversion?', # available only in installer/upgrade
label=_('IPA DNS version'),
),
+ Str(
+ 'dns_server_server*',
+ label=_('IPA DNS servers'),
+ doc=_('List of IPA masters configured as DNS servers'),
+ flags={'virtual_attribute', 'no_create', 'no_update'}
+ ),
+ Str(
+ 'dnssec_key_master_server?',
+ label=_('IPA DNSSec key master'),
+ doc=_('IPA server configured as DNSSec key master'),
+ flags={'virtual_attribute', 'no_create', 'no_update'}
+ )
)
managed_permissions = {
'System: Write DNS Configuration': {
@@ -4107,9 +4119,22 @@ class dnsconfig(LDAPObject):
return entry
def postprocess_result(self, result):
- if not any(param in result['result'] for param in self.params):
+ is_config_empty = not any(
+ param.name in result['result'] for param in self.params() if
+ u'virtual_attribute' not in param.flags
+ )
+ if is_config_empty:
result['summary'] = unicode(_('Global DNS configuration is empty'))
+ def show_servroles_attributes(self, entry_attrs, **options):
+ if options.get('raw', False):
+ return
+
+ backend = self.api.Backend.serverroles
+ entry_attrs.update(
+ backend.config_retrieve("DNS server")
+ )
+
@register()
class dnsconfig_mod(LDAPUpdate):
@@ -4163,6 +4188,9 @@ class dnsconfig_mod(LDAPUpdate):
return result
+ def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
+ self.obj.show_servroles_attributes(entry_attrs, **options)
+ return dn
@register()
@@ -4174,6 +4202,10 @@ class dnsconfig_show(LDAPRetrieve):
self.obj.postprocess_result(result)
return result
+ def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
+ self.obj.show_servroles_attributes(entry_attrs, **options)
+ return dn
+
@register()