[PATCH 1/2] Always store the information about display mode in ksdata

Vratislav Podzimek vpodzime at redhat.com
Wed Oct 8 08:55:39 UTC 2014


Once we know in which mode we are going to run we should store that information
in ksdata.displaymode so that other parts of the code can make use of it.

Related: rhbz#1073679
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 anaconda | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/anaconda b/anaconda
index 4b6c29a..56c4b95 100755
--- a/anaconda
+++ b/anaconda
@@ -1054,16 +1054,16 @@ if __name__ == "__main__":
     # now start the interface
     setupDisplay(anaconda, opts, addon_paths)
 
+    # we now know in which mode we are going to run so store the information
+    from pykickstart.constants import DISPLAY_MODE_GRAPHICAL, DISPLAY_MODE_CMDLINE, DISPLAY_MODE_TEXT
+    mode_char_to_const = {'g': DISPLAY_MODE_GRAPHICAL, 't': DISPLAY_MODE_TEXT, 'c': DISPLAY_MODE_CMDLINE}
+    ksdata.displaymode.displayMode = mode_char_to_const[anaconda.displayMode]
+
     # if we're in text mode, the resulting system should be too
     # ...unless the kickstart specified otherwise
     if anaconda.displayMode != 'g':
-        if not anaconda.ksdata.xconfig.startX:
-            anaconda.ksdata.skipx.skipx = True
-        from pykickstart.constants import DISPLAY_MODE_CMDLINE, DISPLAY_MODE_TEXT
-        if anaconda.displayMode == 'c':
-            anaconda.ksdata.displaymode.displayMode = DISPLAY_MODE_CMDLINE
-        else:
-            anaconda.ksdata.displaymode.displayMode = DISPLAY_MODE_TEXT
+        if not ksdata.xconfig.startX:
+            ksdata.skipx.skipx = True
 
     if flags.rescue_mode:
         from pyanaconda import rescue
-- 
1.9.3



More information about the anaconda-patches mailing list