[PATCH 1/2] Refresh addons_paths once we know if gui or tui takes place

Vratislav Podzimek vpodzime at redhat.com
Thu Feb 14 12:30:35 UTC 2013


We need addon_paths initialized in early phases for addons' kickstart
classes, but the it should be refreshed once we know wheter it should
contain paths for TUI or GUI installation.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/__init__.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 87f05e4..ba4e3c5 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -34,6 +34,8 @@ from constants import ROOT_PATH
 from tempfile import mkstemp
 
 from pyanaconda.bootloader import get_bootloader
+from pyanaconda import constants
+from pyanaconda import addons
 
 import logging
 log = logging.getLogger("anaconda")
@@ -195,16 +197,24 @@ class Anaconda(object):
             from pyanaconda.ui.gui import GraphicalUserInterface
             self._intf = GraphicalUserInterface(self.storage, self.payload,
                                                 self.instClass)
+
+            # needs to be refreshed now we know if gui or tui will take place
+            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
+                                                     ui_subdir="gui")
         elif self.displayMode in ['t', 'c']: # text and command line are the same
             from pyanaconda.ui.tui import TextUserInterface
             self._intf = TextUserInterface(self.storage, self.payload,
                                            self.instClass)
+
+            # needs to be refreshed now we know if gui or tui will take place
+            addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS,
+                                                     ui_subdir="tui")
         else:
             raise RuntimeError("Unsupported displayMode: %s" % self.displayMode)
 
         if addon_paths:
             self._intf.update_paths(addon_paths)
-        
+
     def writeXdriver(self, root = None):
         # this should go away at some point, but until it does, we
         # need to keep it around.
-- 
1.7.11.7



More information about the anaconda-patches mailing list