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/frontend.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ipalib/frontend.py') diff --git a/ipalib/frontend.py b/ipalib/frontend.py index 18ea7287..7177bd18 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -895,6 +895,7 @@ class Command(HasParam): labels = None else: labels = dict((p.name, unicode(p.label)) for p in self.output_params()) + flags = dict((p.name, p.flags) for p in self.output_params()) for o in self.output: outp = self.output[o] @@ -912,13 +913,13 @@ class Command(HasParam): # Return an error to the shell rv = 1 if isinstance(outp, ListOfEntries): - textui.print_entries(result, order, labels, print_all) + textui.print_entries(result, order, labels, flags, print_all) elif isinstance(result, (tuple, list)): - textui.print_entries(result, order, labels, print_all) + textui.print_entries(result, order, labels, flags, print_all) elif isinstance(outp, Entry): - textui.print_entry(result, order, labels, print_all) + textui.print_entry(result, order, labels, flags, print_all) elif isinstance(result, dict): - textui.print_entry(result, order, labels, print_all) + textui.print_entry(result, order, labels, flags, print_all) elif isinstance(result, unicode): if o == 'summary': textui.print_summary(result) -- cgit