Alon Bar-Lev has uploaded a new change for review. Change subject: core: transaction: remove committed transactions ......................................................................
core: transaction: remove committed transactions required to avoid aborting already committed transaction in case of commit failure of one of the elements. Change-Id: I70b16025e87ee855ae030ab54dd0035d0cd39c37 Signed-off-by: Alon Bar-Lev <[email protected]> --- M src/otopi/transaction.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/84/16784/1 diff --git a/src/otopi/transaction.py b/src/otopi/transaction.py index 3cdd641..2eef80c 100644 --- a/src/otopi/transaction.py +++ b/src/otopi/transaction.py @@ -151,7 +151,11 @@ _('Cannot commit transaction as one of the elements failed') ) - for element in self._prepared: + # remove elements from list + # so that if we fail we won't + # abort committed + while self._prepared: + element = self._prepared.pop() self.logger.debug("committing '%s'", element) element.commit() -- To view, visit http://gerrit.ovirt.org/16784 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70b16025e87ee855ae030ab54dd0035d0cd39c37 Gerrit-PatchSet: 1 Gerrit-Project: otopi Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
