From 6f58f38748085e6a104de6f9e992469d3b685d5a Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 7 Jan 2011 11:17:55 -0500 Subject: Display the entries that failed when deleting with --continue. We collected the failures but didn't report it back. This changes the API of most delete commands so rather than returning a boolean it returns a dict with the only current key as failed. This also adds a new parameter flag, suppress_empty. This will try to not print values that are empty if included. This makes the output of the delete commands a bit prettier. ticket 687 --- ipalib/plugins/baseldap.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index ecc3fd0b..fbe4fcec 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -136,6 +136,10 @@ global_output_params = ( Str('memberuser', label=_('Failed users/groups'), ), + Str('failed', + label=_('Failed to remove'), + flags=['suppress_empty'], + ), ) @@ -937,8 +941,8 @@ class LDAPDelete(LDAPMultiQuery): deleted.append(pkey) if self.obj.primary_key and pkeyiter[0] is not None: - return dict(result=result, value=u','.join(deleted)) - return dict(result=result, value=u'') + return dict(result=dict(failed=u','.join(failed)), value=u','.join(deleted)) + return dict(result=dict(failed=u''), value=u'') def pre_callback(self, ldap, dn, *keys, **options): return dn -- cgit