Module: check_mk
Branch: master
Commit: a280d703f393b094ab31a4e20cd422d2811bc2f9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a280d703f393b0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 7 13:43:06 2011 +0100
WATO: better debugging of remote automation
---
web/htdocs/wato.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9acf5a0..02cfade 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2536,11 +2536,11 @@ def mode_changelog(phase):
raise MKUserError(None, _("Cannot synchronize site:
%s") % response)
except MKAutomationException, e:
- raise MKUserError(None, _("Remote command on site %s failed:
'%s'.") % (site_id, e))
+ raise MKUserError(None, _("Remote command on site %s failed:
<pre>%s</pre>") % (site_id, e))
except Exception, e:
if config.debug:
raise
- raise MKUserError(None, _("Remote command on site %s failed:
'%s'.") % (site_id, e))
+ raise MKUserError(None, _("Remote command on site %s failed:
<pre>%s</pre>") % (site_id, e))
elif html.check_transaction():
config.need_permission("wato.activate")
@@ -6805,7 +6805,6 @@ def automation_push_snapshot():
raise MKGeneralException(_("Configuration error. You treat us as "
"a peer, but we have no peer configuration!"))
-
# In peer mode, we have a replication configuration ourselves and
# we have a site ID our selves. Let's make sure that ID matches
# the ID our peer thinks we have.
@@ -6835,7 +6834,10 @@ def automation_push_snapshot():
call_hook_activate_changes()
return True
except Exception, e:
- return str(e)
+ if config.debug:
+ return _("Internal automation error: %s\n%s") % (str(e),
format_exception())
+ else:
+ return _("Internal automation error: %s") % e
def create_only_hosts_file(siteid):
out = file(defaults.check_mk_configdir + "/only_hosts.mk", "w")