[PATCH (nice to have)] Don't prompt when in cmdline mode (#869685)

Jesse Keating jkeating at redhat.com
Mon Oct 29 23:45:57 UTC 2012


cmdline mode is text mode only, so that's why this patch only touches
the tui code.
---
 pyanaconda/ui/tui/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 9f34c4a..b20dc17 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -21,6 +21,7 @@
 
 from pyanaconda import ui
 from pyanaconda.ui import common
+from pyanaconda.flags import flags
 import simpleline as tui
 from hubs.summary import SummaryHub
 from hubs.progress import ProgressHub
@@ -182,7 +183,12 @@ class TextUserInterface(ui.UserInterface):
            In the code, this method should be used sparingly and only for those
            times where anaconda cannot make a reasonable decision.  We don't
            want to overwhelm the user with choices.
+
+           When cmdline mode is active, the default will be to answer no.
         """
+        if flags.automatedInstall and not flags.ksprompt:
+            # If we're in cmdline mode, just say no.
+            return False
         question_window = YesNoDialog(self._app, message)
         self._app.switch_screen_modal(question_window)
         return question_window.answer
-- 
1.7.11.4



More information about the anaconda-patches mailing list