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 <pspacek@redhat.com>
This commit is contained in:
Martin Babinsky authored and Martin Basti committed 2016-09-26 18:38:37 +02:00
1 parent 347f5ca0e1
commit f7764cda68
2 files changed
+3 -6

No files matched your search

+2 -2
View File
@@ -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):
+1 -4
View File
@@ -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