summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-lint
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-06-22 17:01:40 -0500
committerNarayan Desai <desai@mcs.anl.gov>2011-06-22 17:01:40 -0500
commit4849378a62ab0dbf72f8ce4e6b2073dc73f2337a (patch)
tree14945dd6045c438f5dbc8e96f023258d31e1adf9 /src/sbin/bcfg2-lint
parent8d08d5195fa0b6f503752273183948e5d24f33d6 (diff)
parent2db056574f5f55c3c802da63abe7e3de10db5d76 (diff)
downloadbcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.gz
bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.tar.bz2
bcfg2-4849378a62ab0dbf72f8ce4e6b2073dc73f2337a.zip
Merge branch 'master' of git.mcs.anl.gov:bcfg2
Diffstat (limited to 'src/sbin/bcfg2-lint')
-rwxr-xr-xsrc/sbin/bcfg2-lint23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint
index 6bc34433e..464e839e5 100755
--- a/src/sbin/bcfg2-lint
+++ b/src/sbin/bcfg2-lint
@@ -50,10 +50,13 @@ def run_plugin(plugin, plugin_name, setup=None, errorhandler=None,
errorhandler = get_errorhandler(config)
if config is not None and config.has_section(plugin_name):
- args.append(dict(config.items(plugin_name), **setup))
+ arg = setup
+ for key, val in config.items(plugin_name):
+ arg[key] = val
+ args.append(arg)
else:
args.append(setup)
-
+
# older versions of python do not support mixing *-magic and
# non-*-magic (e.g., "plugin(*args, files=files)", so we do this
# all with *-magic
@@ -181,8 +184,20 @@ if __name__ == '__main__':
config=config, setup=setup)
if serverplugins:
- run_server_plugins(serverplugins, errorhandler=errorhandler,
- config=config, setup=setup)
+ if errorhandler.errors:
+ # it would be swell if we could try to start the server
+ # even if there were errors with the serverless plugins,
+ # but since XML parsing errors occur in the FAM thread
+ # (not in the core server thread), there's no way we can
+ # start the server and try to catch exceptions --
+ # bcfg2-lint isn't in the same stack as the exceptions.
+ # so we're forced to assume that a serverless plugin error
+ # will prevent the server from starting
+ print("Serverless plugins encountered errors, skipping server "
+ "plugins")
+ else:
+ run_server_plugins(serverplugins, errorhandler=errorhandler,
+ config=config, setup=setup)
if errorhandler.errors or errorhandler.warnings or setup['verbose']:
print("%d errors" % errorhandler.errors)