summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Bundler.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Bundler.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Bundler.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Bundler.py b/src/lib/Bcfg2/Server/Plugins/Bundler.py
index b200346bc..6dc3c2b1d 100644
--- a/src/lib/Bcfg2/Server/Plugins/Bundler.py
+++ b/src/lib/Bcfg2/Server/Plugins/Bundler.py
@@ -1,15 +1,15 @@
"""This provides bundle clauses with translation functionality."""
-import copy
-import logging
-import lxml.etree
import os
-import os.path
import re
import sys
+import copy
+import logging
+import lxml.etree
import Bcfg2.Server
import Bcfg2.Server.Plugin
import Bcfg2.Server.Lint
+from Bcfg2.Options import get_option_parser
try:
import genshi.template.base
@@ -19,9 +19,6 @@ except ImportError:
HAS_GENSHI = False
-SETUP = None
-
-
class BundleFile(Bcfg2.Server.Plugin.StructFile):
""" Representation of a bundle XML file """
def get_xml_value(self, metadata):
@@ -52,8 +49,9 @@ if HAS_GENSHI:
msg = "No parsed template information for %s" % self.name
self.logger.error(msg)
raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
- stream = self.template.generate(metadata=metadata,
- repo=SETUP['repo']).filter(
+ stream = self.template.generate(
+ metadata=metadata,
+ repo=get_option_parser()['repo']).filter(
Bcfg2.Server.Plugins.TGenshi.removecomment)
data = lxml.etree.XML(stream.render('xml',
strip_whitespace=False),
@@ -102,9 +100,6 @@ class Bundler(Bcfg2.Server.Plugin.Plugin,
self.logger.error(msg)
raise Bcfg2.Server.Plugin.PluginInitError(msg)
- global SETUP
- SETUP = core.setup
-
def template_dispatch(self, name, _):
""" Add the correct child entry type to Bundler depending on
whether the XML file in question is a plain XML file or a