diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-04-25 08:40:26 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-04-25 08:40:26 -0400 |
commit | 66642f84fd71e9230245b11718bf9a7e96ba0c7f (patch) | |
tree | 84b2e2daa5db15f88c82dcf97ad8711a8cafdf2c | |
parent | e9047ac894dc064a34bd8026f49fc186121b6cfc (diff) | |
download | bcfg2-66642f84fd71e9230245b11718bf9a7e96ba0c7f.tar.gz bcfg2-66642f84fd71e9230245b11718bf9a7e96ba0c7f.tar.bz2 bcfg2-66642f84fd71e9230245b11718bf9a7e96ba0c7f.zip |
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
-rw-r--r-- | examples/bcfg2-lint.conf | 2 | ||||
-rw-r--r-- | man/bcfg2-lint.conf.5 | 10 | ||||
-rwxr-xr-x | 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']: |