Add 'continuous' mode to LDAPDelete. Fix *-del unit tests.

Ticket #321
This commit is contained in:
Pavel Zuna
2010-10-06 09:20:41 -04:00
committed by Rob Crittenden
parent bf053652bc
commit 9832780414
+9
View File
@@ -353,6 +353,13 @@ class LDAPMultiQuery(LDAPQuery):
"""
Base class for commands that need to retrieve one or more existing entries.
"""
takes_options = (
Flag('continue',
cli_name='continue',
doc=_('Continuous mode: Don\'t stop on errors.'),
),
)
def get_args(self):
for key in self.obj.get_ancestor_primary_keys():
yield key
@@ -594,6 +601,8 @@ class LDAPDelete(LDAPMultiQuery):
if not delete_entry(pkey):
result = False
except errors.ExecutionError:
if not options.get('continuous', False):
raise
failed.append(pkey)
else:
deleted.append(pkey)