pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0071-vault-Fix-param-labels-in-output-of-vault-owner-comm.patch

590d18
From ddb58a9dd79558764c992a4a965c2cca404b615a Mon Sep 17 00:00:00 2001
590d18
From: Jan Cholasta <jcholast@redhat.com>
590d18
Date: Mon, 17 Aug 2015 09:39:48 +0200
590d18
Subject: [PATCH] vault: Fix param labels in output of vault owner commands
590d18
590d18
https://fedorahosted.org/freeipa/ticket/5214
590d18
590d18
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
590d18
---
590d18
 ipalib/plugins/vault.py | 12 ++++++++++++
590d18
 1 file changed, 12 insertions(+)
590d18
590d18
diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
590d18
index 01c6096335d47b337253d4f2d1e0571200383c7a..b5a12d5c3da599d7f5afaed90f579ad3a23c27cd 100644
590d18
--- a/ipalib/plugins/vault.py
590d18
+++ b/ipalib/plugins/vault.py
590d18
@@ -314,6 +314,11 @@ class vault(LDAPObject):
590d18
             label=_('Owner services'),
590d18
             flags=['no_create', 'no_update', 'no_search'],
590d18
         ),
590d18
+        Str(
590d18
+            'owner?',
590d18
+            label=_('Failed owners'),
590d18
+            flags=['no_create', 'no_update', 'no_search'],
590d18
+        ),
590d18
     )
590d18
 
590d18
     def get_dn(self, *keys, **options):
590d18
@@ -1420,6 +1425,11 @@ class VaultModMember(LDAPModMember):
590d18
             options.pop('service', None)
590d18
         return super(VaultModMember, self).get_member_dns(**options)
590d18
 
590d18
+    def post_callback(self, ldap, completed, failed, dn, entry_attrs, *keys, **options):
590d18
+        for fail in failed.itervalues():
590d18
+            fail['services'] = fail.pop('service', [])
590d18
+        return completed, dn
590d18
+
590d18
 
590d18
 @register()
590d18
 class vault_add_owner(VaultModMember, LDAPAddMember):
590d18
@@ -1428,6 +1438,7 @@ class vault_add_owner(VaultModMember, LDAPAddMember):
590d18
     takes_options = LDAPAddMember.takes_options + vault_options
590d18
 
590d18
     member_attributes = ['owner']
590d18
+    member_param_label = _('owner %s')
590d18
     member_count_out = ('%i owner added.', '%i owners added.')
590d18
 
590d18
     has_output = (
590d18
@@ -1452,6 +1463,7 @@ class vault_remove_owner(VaultModMember, LDAPRemoveMember):
590d18
     takes_options = LDAPRemoveMember.takes_options + vault_options
590d18
 
590d18
     member_attributes = ['owner']
590d18
+    member_param_label = _('owner %s')
590d18
     member_count_out = ('%i owner removed.', '%i owners removed.')
590d18
 
590d18
     has_output = (
590d18
-- 
590d18
2.4.3
590d18