From 2b9a7579e64cd02e1a0defaf941d33a4bb5265f0 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Tue, 12 Feb 2013 12:08:54 +0100 Subject: Use ksdata.addons instead of ksdata.addon and add ADDON_PATHS to sys.path 'ksdata.addons' makes more sense than 'ksdata.addon' since it is a root of the tree where addons live. ADDON_PATHS are needed in sys.path so that imports in addons' sources work. --- anaconda | 4 ++++ pyanaconda/addons.py | 2 +- pyanaconda/install.py | 4 ++-- pyanaconda/kickstart.py | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/anaconda b/anaconda index 5c0976878..d63d431c1 100755 --- a/anaconda +++ b/anaconda @@ -300,6 +300,10 @@ def setupPythonPath(): # First add our updates path sys.path.insert(0, '/tmp/updates/') + from pyanaconda.constants import ADDON_PATHS + # append ADDON_PATHS dirs at the end + sys.path.extend(ADDON_PATHS) + def setupEnvironment(): # Silly GNOME stuff if os.environ.has_key('HOME') and not os.environ.has_key("XAUTHORITY"): diff --git a/pyanaconda/addons.py b/pyanaconda/addons.py index 4d817489b..2500f25a5 100644 --- a/pyanaconda/addons.py +++ b/pyanaconda/addons.py @@ -148,7 +148,7 @@ class AddonSection(Section): if not self.addon_id: return - addon = getattr(self.handler.addon, self.addon_id) + addon = getattr(self.handler.addons, self.addon_id) addon.handle_line(line) def handleHeader(self, lineno, args): diff --git a/pyanaconda/install.py b/pyanaconda/install.py index b1d3a1dd5..59356a571 100644 --- a/pyanaconda/install.py +++ b/pyanaconda/install.py @@ -80,7 +80,7 @@ def doConfiguration(storage, payload, ksdata, instClass): ksdata.user.execute(storage, ksdata, instClass, u) with progress_report(_("Configuring addons")): - ksdata.addon.execute(storage, ksdata, instClass, u) + ksdata.addons.execute(storage, ksdata, instClass, u) ksdata.configured_spokes.execute(storage, ksdata, instClass, u) with progress_report(_("Running post install scripts")): @@ -113,7 +113,7 @@ def doInstall(storage, payload, ksdata, instClass): progress.send_init(steps) with progress_report(_("Setting up the install environment")): - ksdata.addon.setup(storage, ksdata, instClass) + ksdata.addons.setup(storage, ksdata, instClass) # Do partitioning. payload.preStorage() diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index c2249f675..83ac6af41 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -1402,13 +1402,13 @@ class AnacondaKSHandler(superclass): # Prepare the structure to track configured spokes self.configured_spokes = SpokeRegistry() - + # Prepare the final structures for 3rd party addons - self.addon = AddonRegistry(addons) + self.addons = AddonRegistry(addons) def __str__(self): - return superclass.__str__(self) + "\n" + str(self.addon) - + return superclass.__str__(self) + "\n" + str(self.addons) + class AnacondaPreParser(KickstartParser): # A subclass of KickstartParser that only looks for %pre scripts and # sets them up to be run. All other scripts and commands are ignored. -- cgit