Module: check_mk
Branch: master
Commit: c46e28510f829d42b1a780d63b5d410d69c62cb9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c46e28510f829d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 1 09:32:40 2015 +0200
Improved error handling during upload of MIB files
---
mkeventd/web/plugins/wato/mkeventd.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mkeventd/web/plugins/wato/mkeventd.py
b/mkeventd/web/plugins/wato/mkeventd.py
index aa710cd..56427b5 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -2000,14 +2000,14 @@ def validate_and_compile_mib(mibname, content):
results = compiler.compile(mibname, ignoreErrors=True, genTexts=True)
errors = []
- for name, state in sorted(results.items()):
- if mibname == name and state == 'failed':
- raise Exception(_('Failed to compile your module.'))
+ for name, state_obj in sorted(results.items()):
+ if mibname == name and state_obj == 'failed':
+ raise Exception(_('Failed to compile your module: %s') %
state_obj.error)
- if state == 'missing':
+ if state_obj == 'missing':
errors.append(_('%s - Dependency missing') % name)
- elif state == 'failed':
- errors.append(_('%s - Failed to compile') % name)
+ elif state_obj == 'failed':
+ errors.append(_('%s - Failed to compile (%s)') % (name,
state_obj.error))
msg = _("MIB file %s uploaded.") % mibname
if errors: