On 8/26/2011 11:41 AM, Petr Vobornik wrote:

Currently adding or deleting sudo options will refresh the entire page.
It's not a problem but the code could be optimized to refresh only the
sudo options table

We have several scenarios for sudo options:

1. Add succeeded: The command returns the new record, so we can use it to load the table. No problem here.

2. Add failed: We may be able to assume the data on the server didn't change, so we don't have to update the table. (Yes, the old code does a refresh, but I don't think it's necessary.)

3. Delete batch failed: I think we can assume nothing was executed, same as #2.

4. Delete batch succeeded: It could contain a mix of successes and failures. Like you said, we should use the last successful result.

But instead of checking only the last result and do a load() or update(), we could iterate through the results and find the last successful one (the one with non-empty result).

If we find one, then we can use it to load the table. If there isn't any, it means all failed, so we don't do anything, same as #2.

What do you think?

Endi S. Dewata

Freeipa-devel mailing list

Reply via email to