[rhel7/master] fix raising text ui exceptions (#997661)
Brian C. Lane
bcl at redhat.com
Thu Aug 15 23:22:20 UTC 2013
From: "Brian C. Lane" <bcl at redhat.com>
In text mode the exceptions can only be processed in the main loop.
Calling ui.run() was causing it to get stuck in a loop. Instead just
raise it and the system exception handler and meh do the right thing.
---
pyanaconda/errors.py | 5 +----
pyanaconda/threads.py | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 8d896ad..e52fb73 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -241,7 +241,7 @@ class ErrorHandler(object):
"""
rc = ERROR_RAISE
- if not self.ui:
+ if not self.ui or isinstance(self.ui, TextUserInterface):
raise
_map = {"KickstartError": self._kickstartErrorHandler,
@@ -264,9 +264,6 @@ class ErrorHandler(object):
kwargs["exception"] = exn
rc = _map[exn.__class__.__name__](*args, **kwargs)
- if isinstance(self.ui, TextUserInterface):
- self.ui.run()
-
return rc
# Create a singleton of the ErrorHandler class. It is up to the UserInterface
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 69da475..fe4b91f 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -49,7 +49,7 @@ class ThreadManager(object):
and start it. It is assumed that obj.name is unique and descriptive.
"""
if obj.name in self._objs:
- raise KeyError
+ raise KeyError("%s is already running" % obj.name)
self._objs[obj.name] = obj
self._errors[obj.name] = None
--
1.8.3.1
More information about the anaconda-patches
mailing list