From 60f57183036dfdaad43722f2706fa44be9ec4fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ka=C5=88kovsk=C3=BD?= Date: Wed, 1 Nov 2023 18:03:15 +0100 Subject: [PATCH] Make possible to start TUI with installed WebUI --- pyanaconda/anaconda.py | 12 ++++-------- pyanaconda/core/constants.py | 2 -- pyanaconda/display.py | 3 ++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py index 5da8656430c..fad8e85b19e 100644 --- a/pyanaconda/anaconda.py +++ b/pyanaconda/anaconda.py @@ -148,13 +148,9 @@ def tui_mode(self): return self._display_mode == DisplayModes.TUI @property - def webui_mode(self): - """Report if Anaconda should run with WebUI.""" - # this boot option is meant to be temporary, so just check it directly - # from kernel boot command line like this - return self.display_mode == DisplayModes.WEBUI \ - or "webui" in kernel_arguments \ - or os.path.exists("/usr/share/cockpit/anaconda-webui") + def is_webui_supported(self): + "Report if webui package is installed" + return os.path.exists("/usr/share/cockpit/anaconda-webui") def log_display_mode(self): if not self.display_mode: @@ -209,7 +205,7 @@ def initInterface(self): if self._intf: raise RuntimeError("Second attempt to initialize the InstallInterface") - if self.webui_mode: + if self.gui_mode and self.is_webui_supported: from pyanaconda.ui.webui import CockpitUserInterface self._intf = CockpitUserInterface( None, diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py index b9861ea4f9b..40e9adf171b 100644 --- a/pyanaconda/core/constants.py +++ b/pyanaconda/core/constants.py @@ -303,13 +303,11 @@ class SecretStatus(Enum): class DisplayModes(Enum): GUI = "GUI" TUI = "TUI" - WEBUI = "WEBUI" DISPLAY_MODE_NAME = { DisplayModes.GUI: "graphical mode", DisplayModes.TUI: "text mode", - DisplayModes.WEBUI: "webui mode" } INTERACTIVE_MODE_NAME = { diff --git a/pyanaconda/display.py b/pyanaconda/display.py index 2b67b9af3c0..8e5527161e2 100644 --- a/pyanaconda/display.py +++ b/pyanaconda/display.py @@ -302,7 +302,8 @@ def setup_display(anaconda, options): if vnc_server.vncconnectport == "": vnc_server.vncconnectport = anaconda.ksdata.vnc.port - if anaconda.gui_mode: + # check if GUI without WebUI + if anaconda.gui_mode and not anaconda.is_webui_supported: mods = (tup[1] for tup in pkgutil.iter_modules(pyanaconda.ui.__path__, "pyanaconda.ui.")) if "pyanaconda.ui.gui" not in mods: stdout_log.warning("Graphical user interface not available, falling back to text mode")