From f7764cda6824a2fe73abe11f6daa28758a185319 Mon Sep 17 00:00:00 2001 From: Martin Babinsky Date: Tue, 20 Sep 2016 15:15:50 +0200 Subject: Make Continuous installer continuous only during execution phase `common.Continuous` class is a basis for uninstallers, which should execute all the steps regardless of occuring errors. However, we would like the installer to raise exceptions and return non-zero exit code during validation phase when some preconditions are not met. Add a separate exception handler which catches exceptions and logs them as errors during execution phase only. https://fedorahosted.org/freeipa/ticket/5725 Reviewed-By: Petr Spacek --- ipapython/install/common.py | 4 ++-- ipapython/install/core.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'ipapython') diff --git a/ipapython/install/common.py b/ipapython/install/common.py index 799ce5009..fc8e33291 100644 --- a/ipapython/install/common.py +++ b/ipapython/install/common.py @@ -86,9 +86,9 @@ class Interactive(core.Configurable): class Continuous(core.Configurable): - def _handle_exception(self, exc_info): + def _handle_execute_exception(self, exc_info): try: - super(Continuous, self)._handle_exception(exc_info) + super(Continuous, self)._handle_execute_exception(exc_info) except BaseException as e: self.log.debug(traceback.format_exc()) if isinstance(e, Exception): diff --git a/ipapython/install/core.py b/ipapython/install/core.py index 881d3c6e3..8593690b3 100644 --- a/ipapython/install/core.py +++ b/ipapython/install/core.py @@ -375,11 +375,8 @@ class Configurable(six.with_metaclass(abc.ABCMeta, object)): try: exc_handler(exc_info) except BaseException: - raise - else: - break - finally: self.__transition(running_state, _FAILED) + raise if self.__state != running_state: break -- cgit