From 661d1f6d2789e855eff4fca38e6f4a0a564da728 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 17 Jan 2013 13:32:56 -0500 Subject: removed passing of optionparser object amongst Packages plugin --- src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py index afa5da4c5..f528076c4 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py @@ -4,6 +4,7 @@ import os import sys import Bcfg2.Server.Plugin +from Bcfg2.Options import get_option_parser from Bcfg2.Server.Plugins.Packages.Source import SourceInitError @@ -19,7 +20,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, encryption = False - def __init__(self, filename, cachepath, fam, packages, setup): + def __init__(self, filename, cachepath, fam, packages): """ :param filename: The full path to ``sources.xml`` :type filename: string @@ -34,8 +35,6 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, being parsed on behalf of (i.e., the calling object) :type packages: Bcfg2.Server.Plugins.Packages.Packages - :param setup: A Bcfg2 options dict - :type setup: dict :raises: :class:`Bcfg2.Server.Plugin.exceptions.PluginInitError` - If ``sources.xml`` cannot be read @@ -64,7 +63,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, self.logger.error("Could not create Packages cache at %s: %s" % (self.cachepath, err)) #: The Bcfg2 options dict - self.setup = setup + self.setup = get_option_parser() #: The :class:`Bcfg2.Server.Plugins.Packages.Packages` that #: instantiated this ``PackagesSources`` object @@ -159,7 +158,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, return None try: - source = cls(self.cachepath, xsource, self.setup) + source = cls(self.cachepath, xsource) except SourceInitError: err = sys.exc_info()[1] self.logger.error("Packages: %s" % err) -- cgit v1.2.3-1-g7c22