From 66642f84fd71e9230245b11718bf9a7e96ba0c7f Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 25 Apr 2011 08:40:26 -0400 Subject: changed [main] section of bcfg2-lint.conf to [lint] to make it possible to combine config files get full stack trace from failed plugins for easier troubleshooting --- examples/bcfg2-lint.conf | 2 +- man/bcfg2-lint.conf.5 | 10 +++++++++- src/sbin/bcfg2-lint | 8 ++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/bcfg2-lint.conf b/examples/bcfg2-lint.conf index 1d3a82160..dbb69dbb2 100644 --- a/examples/bcfg2-lint.conf +++ b/examples/bcfg2-lint.conf @@ -1,4 +1,4 @@ -[main] +[lint] plugins=Duplicates,InfoXML,Bundles,Headers,RequiredAttrs,Validate [InfoXML] diff --git a/man/bcfg2-lint.conf.5 b/man/bcfg2-lint.conf.5 index 2c89a1161..e2b8e79fa 100644 --- a/man/bcfg2-lint.conf.5 +++ b/man/bcfg2-lint.conf.5 @@ -21,11 +21,19 @@ a comment, a section name or an option. Any line beginning with a hash (#) is ignored, as are lines containing only whitespace. +The file consists of one +.I [lint] +section, and then any number of plugin-specific sections, documented below. (Note that this makes it quite feasible to combine your +.B bcfg2-lint.conf +into your +.B bcfg2.conf(5) +file, if you so desire.) + .SH GLOBAL OPTIONS These options apply to .I bcfg2-lint generally, and must be in the -.I [main] +.I [lint] section. .TP diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint index cfb37a206..e6a530408 100755 --- a/src/sbin/bcfg2-lint +++ b/src/sbin/bcfg2-lint @@ -63,11 +63,7 @@ def run_plugin(plugin, plugin_name, setup=None, args=None, config=None, # all with *-magic kwargs = dict(files=files) - try: - return plugin(*args, **kwargs).Run() - except Exception, err: - logger.error("Failed to run plugin %s: %s" % (plugin, err)) - raise SystemExit(1) + return plugin(*args, **kwargs).Run() def load_server(setup): """ load server """ @@ -126,7 +122,7 @@ if __name__ == '__main__': elif "bcfg2-repo-validate" in sys.argv[0]: allplugins = 'Duplicates,RequiredAttrs,Validate'.split(',') else: - allplugins = config.get('main', 'plugins', + allplugins = config.get('lint', 'plugins', ",".join(Bcfg2.Server.Lint.__all__)).split(',') if setup['stdin']: -- cgit v1.2.3-1-g7c22