Change in ovirt-engine[master]: packaging: Updated interaction with user on async tasks

oschreib at redhat.com oschreib at redhat.com
Sun Nov 4 13:34:13 UTC 2012


Ofer Schreiber has submitted this change and it was merged.

Change subject: packaging: Updated interaction with user on async tasks
......................................................................


packaging: Updated interaction with user on async tasks

* The previous try/finally clause included the initial interaction with
the user, where tasks were found and user was asked whether to continue
(and if user continues, then restart engine in maintenance mode), as well
as some operations that could end with an exception.

If, for example, user chooses not to continue, 'finally' will kick in,
and try to restore the engine configuration, although it didn't change yet.
Additionally, the setting "zombie tasks" timeout could fail and raise an
exception, which would also try to restore both an engine AND "zombie tasks
timeout", which is not set yes, leading to an incorrect setting.

This patch aims to solve these issues by moving try/finally block to the
later code, beginning only with the final loop, when a user has agreed
to it.

* Also, added additional try/finally block to the configureForMaintenance
function, so that in case the creation of the temp configuration fails,
we would still try to cleanup the file if it was created and raise the
exception.

* Also, changed the return value in getRunningTasks and getCompensation
functions from "return None" to empty string "return ''". This improves
the printouts to the user, and instead of printing "None" in tasks,
nothing is printed if no tasks are found.

Change-Id: Ia1f1aaf7ac812d69dc81f3fb8dee5a626bc7634a
Signed-off-by: Alex Lourie <alourie at redhat.com>
---
M packaging/fedora/setup/common_utils.py
M packaging/fedora/setup/engine-upgrade.py
M packaging/fedora/setup/output_messages.py
3 files changed, 66 insertions(+), 35 deletions(-)

Approvals:
  Ofer Schreiber: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/8952
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1f1aaf7ac812d69dc81f3fb8dee5a626bc7634a
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <alourie at redhat.com>
Gerrit-Reviewer: Alex Lourie <alourie at redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Kiril Nesenko <knesenko at redhat.com>
Gerrit-Reviewer: Moran Goldboim <mgoldboi at redhat.com>
Gerrit-Reviewer: Ofer Schreiber <oschreib at redhat.com>
Gerrit-Reviewer: Ohad Basan <obasan at redhat.com>



More information about the Engine-commits mailing list