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
* 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
* Also, changed the return value in getRunningTasks and getCompensation
functions from "return None" to empty string "return ''". This
the printouts to the user, and instead of printing "None" in tasks,
nothing is printed if no tasks are found.
Signed-off-by: Alex Lourie <alourie(a)redhat.com>
3 files changed, 66 insertions(+), 35 deletions(-)
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-Owner: Alex Lourie <alourie(a)redhat.com>
Gerrit-Reviewer: Alex Lourie <alourie(a)redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Kiril Nesenko <knesenko(a)redhat.com>
Gerrit-Reviewer: Moran Goldboim <mgoldboi(a)redhat.com>
Gerrit-Reviewer: Ofer Schreiber <oschreib(a)redhat.com>
Gerrit-Reviewer: Ohad Basan <obasan(a)redhat.com>