Even though managedBy output parameter was only used for failed host
managedBy memberships, it was defined in global baseldap.py
classes. Incorrect label was then being displayed also for DNS zone
per-zone permission attribute with the same name.

Move managedBy output parameter to host plugin. Define proper managedBy
output parameter in DNS plugin to improve clarity of this attribute.

https://fedorahosted.org/freeipa/ticket/2946

>From f0cb4790911c946e58c07957ecfa0467ae81f183 Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Fri, 17 Aug 2012 11:00:37 +0200
Subject: [PATCH] Fix managedBy label for DNS zone

Even though managedBy output parameter was only used for failed host
managedBy memberships, it was defined in global baseldap.py
classes. Incorrect label was then being displayed also for DNS zone
per-zone permission attribute with the same name.

Move managedBy output parameter to host plugin. Define proper managedBy
output parameter in DNS plugin to improve clarity of this attribute.

https://fedorahosted.org/freeipa/ticket/2946
---
 ipalib/plugins/baseldap.py |  3 ---
 ipalib/plugins/dns.py      | 13 +++++++++++++
 ipalib/plugins/host.py     |  3 +++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 011d626291b797406c63c249e6d315429f260ad7..5805ba9b7344fd193627c419ff060698322f6ee4 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -169,9 +169,6 @@ global_output_params = (
     Str('memberservice',
         label=_('Failed service/service groups'),
     ),
-    Str('managedby',
-        label=_('Failed managedby'),
-    ),
     Str('failed',
         label=_('Failed to remove'),
         flags=['suppress_empty'],
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 991eb0164710c9023a6e7f13f18447a70de3c66b..bd637dcd8883d6d91ed69f5bdb31443591a87ee1 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -1531,6 +1531,12 @@ def default_zone_update_policy(zone):
     else:
         return get_dns_forward_zone_update_policy(api.env.realm)
 
+dnszone_output_params = (
+    Str('managedby',
+        label=_('Managedby permission'),
+    ),
+)
+
 class dnszone(LDAPObject):
     """
     DNS Zone, container for resource records.
@@ -1717,6 +1723,7 @@ api.register(dnszone)
 class dnszone_add(LDAPCreate):
     __doc__ = _('Create new DNS zone (SOA record).')
 
+    has_output_params = LDAPCreate.has_output_params + dnszone_output_params
     takes_options = LDAPCreate.takes_options + (
         Flag('force',
              label=_('Force'),
@@ -1783,12 +1790,16 @@ api.register(dnszone_del)
 class dnszone_mod(LDAPUpdate):
     __doc__ = _('Modify DNS zone (SOA record).')
 
+    has_output_params = LDAPUpdate.has_output_params + dnszone_output_params
+
 api.register(dnszone_mod)
 
 
 class dnszone_find(LDAPSearch):
     __doc__ = _('Search for DNS zones (SOA records).')
 
+    has_output_params = LDAPSearch.has_output_params + dnszone_output_params
+
     def args_options_2_params(self, *args, **options):
         # FIXME: Check that name_from_ip is valid. This is necessary because
         #        custom validation rules, including _validate_ipnet, are not
@@ -1833,6 +1844,8 @@ api.register(dnszone_find)
 class dnszone_show(LDAPRetrieve):
     __doc__ = _('Display information about a DNS zone (SOA record).')
 
+    has_output_params = LDAPRetrieve.has_output_params + dnszone_output_params
+
 api.register(dnszone_show)
 
 
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index a417ba0f7260522661c1045077af1462ff3c410e..319bdf720cf6f7696a4017cdbc81704fe21f6d04 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -172,6 +172,9 @@ host_output_params = (
     Str('revocation_reason?',
         label=_('Revocation reason'),
     ),
+    Str('managedby',
+        label=_('Failed managedby'),
+    ),
 )
 
 def validate_ipaddr(ugettext, ipaddr):
-- 
1.7.11.2

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to