[anaconda 6/6] In tui cmdline mode skip showError and log message

Brian C. Lane bcl at redhat.com
Wed Aug 6 19:23:00 UTC 2014


When running in tui mode we don't want to prompt, it may cause automated
installations to get stuck. Instead log the message that would have been
shown and continue.
---
 pyanaconda/ui/tui/__init__.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index cb510b5..0fb1ca7 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -33,6 +33,8 @@ import sys
 import site
 import Queue
 import meh.ui.text
+import logging
+log = logging.getLogger("anaconda")
 
 def exception_msg_handler(event, data):
     """
@@ -258,6 +260,11 @@ class TextUserInterface(ui.UserInterface):
     def _showError(self, message):
         """Internal helper function that MUST BE CALLED FROM THE MAIN THREAD"""
 
+        if flags.automatedInstall and not flags.ksprompt:
+            log.error(message)
+            # If we're in cmdline mode, just exit.
+            return
+
         error_window = ErrorDialog(self._app, message)
         self._app.switch_screen_modal(error_window)
 
@@ -288,6 +295,7 @@ class TextUserInterface(ui.UserInterface):
         """Internal helper function that MUST BE CALLED FROM THE MAIN THREAD"""
 
         if flags.automatedInstall and not flags.ksprompt:
+            log.error(message)
             # If we're in cmdline mode, just say no.
             return False
 
-- 
1.9.3



More information about the anaconda-patches mailing list