summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-lint
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-05-20 09:58:13 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-05-20 09:58:13 -0400
commit05afbeaf3378d8af4c0342727e80ada9afe4f905 (patch)
tree6a9eb65612081949ff232d5186f62a960bdf5bc0 /src/sbin/bcfg2-lint
parent5d558eff1d9fcb9fd4c4b67841a9b63043e390f8 (diff)
downloadbcfg2-05afbeaf3378d8af4c0342727e80ada9afe4f905.tar.gz
bcfg2-05afbeaf3378d8af4c0342727e80ada9afe4f905.tar.bz2
bcfg2-05afbeaf3378d8af4c0342727e80ada9afe4f905.zip
don't run lint server plugins if serverless plugins produced errors; avoids an ugly stack trace if a file fails to validate
Diffstat (limited to 'src/sbin/bcfg2-lint')
-rwxr-xr-xsrc/sbin/bcfg2-lint16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint
index 3c9bc44b3..464e839e5 100755
--- a/src/sbin/bcfg2-lint
+++ b/src/sbin/bcfg2-lint
@@ -184,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)