summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorMartin Babinsky <mbabinsk@redhat.com>2016-09-20 15:15:50 +0200
committerMartin Basti <mbasti@redhat.com>2016-09-26 18:38:37 +0200
commitf7764cda6824a2fe73abe11f6daa28758a185319 (patch)
treefe3061ac5636112dcae8c560dca5907e63a7ea0c /ipapython
parent347f5ca0e145491d387f60f95b67ef59e7c28316 (diff)
downloadfreeipa-f7764cda6824a2fe73abe11f6daa28758a185319.tar.gz
freeipa-f7764cda6824a2fe73abe11f6daa28758a185319.tar.xz
freeipa-f7764cda6824a2fe73abe11f6daa28758a185319.zip
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>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/install/common.py4
-rw-r--r--ipapython/install/core.py5
2 files changed, 3 insertions, 6 deletions
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