diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-05-20 09:58:13 -0400 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-06-14 12:36:46 -0500 |
commit | 4944977b131be888f4584b4b6b44dba2214d1818 (patch) | |
tree | 6a9eb65612081949ff232d5186f62a960bdf5bc0 | |
parent | bd65a65555b5a70a43b1cdc8a7309cf85d84aa87 (diff) | |
download | bcfg2-4944977b131be888f4584b4b6b44dba2214d1818.tar.gz bcfg2-4944977b131be888f4584b4b6b44dba2214d1818.tar.bz2 bcfg2-4944977b131be888f4584b4b6b44dba2214d1818.zip |
don't run lint server plugins if serverless plugins produced errors; avoids an ugly stack trace if a file fails to validate
-rwxr-xr-x | src/sbin/bcfg2-lint | 16 |
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) |