Hi,

the attached patches fix <https://fedorahosted.org/freeipa/ticket/5214>.

Honza

--
Jan Cholasta
From c6a2774a4a402b448a136a76fc395bef157bec22 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 17 Aug 2015 09:39:21 +0200
Subject: [PATCH 1/2] baseldap: Allow overriding member param label in
 LDAPModMember

https://fedorahosted.org/freeipa/ticket/5214
---
 ipalib/plugins/baseldap.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 0fdc63e..8a05c78 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -1652,6 +1652,7 @@ class LDAPModMember(LDAPQuery):
     """
     member_attributes = ['member']
     member_param_doc = _('%s')
+    member_param_label = _('member %s')
     member_count_out = ('%i member processed.', '%i members processed.')
 
     def get_options(self):
@@ -1662,9 +1663,9 @@ class LDAPModMember(LDAPQuery):
                 ldap_obj = self.api.Object[ldap_obj_name]
                 name = to_cli(ldap_obj_name)
                 doc = self.member_param_doc % ldap_obj.object_name_plural
+                label = self.member_param_label % ldap_obj.object_name
                 yield Str('%s*' % name, cli_name='%ss' % name, doc=doc,
-                          label=_('member %s') % ldap_obj.object_name,
-                          csv=True, alwaysask=True)
+                          label=label, csv=True, alwaysask=True)
 
     def get_member_dns(self, **options):
         dns = {}
-- 
2.4.3

From 0292c91c70c9e3b9a94688c832d0350cf61b8eb0 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Mon, 17 Aug 2015 09:39:48 +0200
Subject: [PATCH 2/2] vault: Fix param labels in output of vault owner commands

https://fedorahosted.org/freeipa/ticket/5214
---
 ipalib/plugins/vault.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
index 60d3254..aa2218a 100644
--- a/ipalib/plugins/vault.py
+++ b/ipalib/plugins/vault.py
@@ -314,6 +314,11 @@ class vault(LDAPObject):
             label=_('Owner services'),
             flags=['no_create', 'no_update', 'no_search'],
         ),
+        Str(
+            'owner?',
+            label=_('Failed owners'),
+            flags=['no_create', 'no_update', 'no_search'],
+        ),
     )
 
     def get_dn(self, *keys, **options):
@@ -1420,6 +1425,11 @@ class VaultModMember(LDAPModMember):
             options.pop('service', None)
         return super(VaultModMember, self).get_member_dns(**options)
 
+    def post_callback(self, ldap, completed, failed, dn, entry_attrs, *keys, **options):
+        for fail in failed.itervalues():
+            fail['services'] = fail.pop('service', [])
+        return completed, dn
+
 
 @register()
 class vault_add_owner(VaultModMember, LDAPAddMember):
@@ -1428,6 +1438,7 @@ class vault_add_owner(VaultModMember, LDAPAddMember):
     takes_options = LDAPAddMember.takes_options + vault_options
 
     member_attributes = ['owner']
+    member_param_label = _('owner %s')
     member_count_out = ('%i owner added.', '%i owners added.')
 
     has_output = (
@@ -1452,6 +1463,7 @@ class vault_remove_owner(VaultModMember, LDAPRemoveMember):
     takes_options = LDAPRemoveMember.takes_options + vault_options
 
     member_attributes = ['owner']
+    member_param_label = _('owner %s')
     member_count_out = ('%i owner removed.', '%i owners removed.')
 
     has_output = (
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to