summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/controllers.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-05-28 13:59:19 -0400
committerRob Crittenden <rcritten@redhat.com>2008-06-03 22:41:09 -0400
commit9bcd31efc5abcfb529b30c8e067cd421e87d7ed4 (patch)
tree017d4a1fed8701e1c9f2e9c1582ff67feec49a09 /ipa-server/ipa-gui/ipagui/controllers.py
parentc58b7a3d7c32147fd8e72de4254bb35191fedc4b (diff)
downloadfreeipa.git-9bcd31efc5abcfb529b30c8e067cd421e87d7ed4.tar.gz
freeipa.git-9bcd31efc5abcfb529b30c8e067cd421e87d7ed4.tar.xz
freeipa.git-9bcd31efc5abcfb529b30c8e067cd421e87d7ed4.zip
Fix issue of double logging in ipa_error.log.
We open the log in ipa_webgui and this was being inherited by TurboGears which uses the same log so everything was getting logged twice. Shut down the log in ipa_webgui at the last possible moment. This will not catch configuration errors. Add a Not Found template. Only print a traceback on 500 errors.
Diffstat (limited to 'ipa-server/ipa-gui/ipagui/controllers.py')
-rw-r--r--ipa-server/ipa-gui/ipagui/controllers.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py
index 1ec56b25..024a804d 100644
--- a/ipa-server/ipa-gui/ipagui/controllers.py
+++ b/ipa-server/ipa-gui/ipagui/controllers.py
@@ -84,11 +84,14 @@ class Root(controllers.RootController):
"""This method is derived from the sample error catcher on
http://docs.turbogears.org/1.0/ErrorReporting."""
try:
- cherrypy._cputil._cp_on_http_error(status, message)
error_msg = self._error_codes.get(status, self._error_codes[None])
url = "%s %s" % (cherrypy.request.method, cherrypy.request.path)
- log.exception("CherryPy %s error (%s) for request '%s'", status,
- error_msg, url)
+ if (status == 500):
+ log.exception("%s error (%s) for request '%s'", status,
+ error_msg, url)
+ else:
+ log.error("%s error (%s) for request '%s'", status,
+ error_msg, url)
if config.get('server.environment') == 'production':
details = ''
@@ -106,9 +109,14 @@ class Root(controllers.RootController):
details = details,
)
+ if status == 404:
+ page_template = 'ipagui.templates.not_found'
+ else:
+ page_template = 'ipagui.templates.unhandled_exception'
+
body = controllers._process_output(
data,
- 'ipagui.templates.unhandled_exception',
+ page_template,
'html',
'text/html',
None