Module: check_mk
Branch: master
Commit: 3fbfeaafc0322b646e610411d1e23d3fdcdf26d7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3fbfeaafc0322b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jul 26 14:21:18 2011 +0200
WATO API: handle special return code False
---
web/htdocs/wato.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5c446b0..5afddd5 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -114,8 +114,15 @@ def page_handler():
else:
newmode = result
+ # If newmode is False, then we shall immediately abort.
+ # This is e.g. the case, if the page outputted non-HTML
+ # data, such as a tarball (in the export function). We must
+ # be sure not to output *any* further data in that case.
+ if newmode == False:
+ return
+
# if newmode is not None, then the mode has been changed
- if newmode != None:
+ elif newmode != None:
if newmode == "": # no further information: configuration
dialog, etc.
if action_message:
html.message(action_message)