summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-lint
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbin/bcfg2-lint')
-rwxr-xr-xsrc/sbin/bcfg2-lint18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint
index 430c4c54f..ab3b6450f 100755
--- a/src/sbin/bcfg2-lint
+++ b/src/sbin/bcfg2-lint
@@ -3,6 +3,7 @@
"""This tool examines your Bcfg2 specifications for errors."""
import sys
+import time
import inspect
import logging
import Bcfg2.Logger
@@ -52,22 +53,27 @@ def run_plugin(plugin, plugin_name, setup=None, errorhandler=None,
args.append(setup)
# python 2.5 doesn't support mixing *magic and keyword arguments
- return plugin(*args, **dict(files=files, errorhandler=errorhandler)).Run()
+ start = time.time()
+ rv = plugin(*args, **dict(files=files, errorhandler=errorhandler)).Run()
+ LOGGER.debug(" Ran %s in %0.2f seconds" % (plugin_name,
+ time.time() - start))
+ return rv
def get_errorhandler(setup):
""" get a Bcfg2.Server.Lint.ErrorHandler object """
if setup.cfp.has_section("errors"):
- conf = dict(setup.cfp.items("errors"))
+ errors = dict(setup.cfp.items("errors"))
else:
- conf = None
- return Bcfg2.Server.Lint.ErrorHandler(config=conf)
+ errors = None
+ return Bcfg2.Server.Lint.ErrorHandler(errors=errors)
def load_server(setup):
""" load server """
core = Bcfg2.Server.Core.BaseCore(setup)
- core.fam.handle_events_in_interval(4)
+ core.load_plugins()
+ core.fam.handle_events_in_interval(0.1)
return core
@@ -92,7 +98,7 @@ def load_plugins(setup):
elif setup['lint_plugins']:
plugin_list = setup['lint_plugins']
else:
- plugin_list = Bcfg2.Server.Lint.__all__
+ plugin_list = Bcfg2.Server.Lint.plugins
allplugins = dict()
for plugin in plugin_list: