summaryrefslogtreecommitdiffstats
path: root/install/share
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-06-25 13:37:27 -0400
committerRob Crittenden <rcritten@redhat.com>2010-07-12 09:32:33 -0400
commitccaf537aa6323c5161d3420b653025771db75010 (patch)
tree2e1e2dc830369d9619244e2ce11b039537578c1c /install/share
parent7f9485f5bfc62f3a9d082d03b8118619bc283a94 (diff)
downloadfreeipa-ccaf537aa6323c5161d3420b653025771db75010.tar.gz
freeipa-ccaf537aa6323c5161d3420b653025771db75010.tar.xz
freeipa-ccaf537aa6323c5161d3420b653025771db75010.zip
Handle errors raised by plugins more gracefully in mod_wsgi.
This started as an effort to display a more useful error message in the Apache error log if retrieving the schema failed. I broadened the scope a little to include limiting the output in the Apache error log so errors are easier to find. This adds a new configuration option, startup_traceback. Outside of lite-server.py it is False by default so does not display the traceback that lead to the StandardError being raised. This makes the mod_wsgi error much easier to follow.
Diffstat (limited to 'install/share')
-rw-r--r--install/share/wsgi.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/install/share/wsgi.py b/install/share/wsgi.py
index 457d8e024..e1c2c7332 100644
--- a/install/share/wsgi.py
+++ b/install/share/wsgi.py
@@ -4,10 +4,14 @@ WSGI appliction for IPA server.
from ipalib import api
api.bootstrap(context='server', debug=True, log=None)
-api.finalize()
-api.log.info('*** PROCESS START ***')
-import ipawebui
-ui = ipawebui.create_wsgi_app(api)
+try:
+ api.finalize()
+except StandardError, e:
+ api.log.error('Failed to start IPA: %s' % e)
+else:
+ api.log.info('*** PROCESS START ***')
+ import ipawebui
+ ui = ipawebui.create_wsgi_app(api)
-# This is the WSGI callable:
-application = api.Backend.session
+ # This is the WSGI callable:
+ application = api.Backend.session