Module: check_mk
Branch: master
Commit: 29d0be51a52873b790da0c7566e48f4f8351193b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=29d0be51a52873…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 9 16:57:45 2016 +0200
Added missing file ; Added cmk module dir to pylint checks
---
lib/exceptions.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++
pylint/pylint-misc | 1 +
2 files changed, 48 insertions(+)
diff --git a/lib/exceptions.py b/lib/exceptions.py
new file mode 100644
index 0000000..3f6ab91
--- /dev/null
+++ b/lib/exceptions.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# never used directly in the code. Just some wrapper to make all of our
+# exceptions handleable with one call
+class MKException(Exception):
+ # Do not use the Exception() __str__, because it uses str()
+ # to convert the message. We want to keep unicode strings untouched
+ # And don't use self.message, because older python versions don't
+ # have this variable set. self.args[0] seems to be the most portable
+ # way at the moment.
+ def __str__(self):
+ return self.args[0]
+
+
+class MKGeneralException(MKException):
+ plain_title = _("General error")
+ title = _("Error")
+
+ def __init__(self, reason):
+ self.reason = reason
+
+ def __str__(self):
+ return self.reason
diff --git a/pylint/pylint-misc b/pylint/pylint-misc
index 09d2de4..7d2ba4f 100755
--- a/pylint/pylint-misc
+++ b/pylint/pylint-misc
@@ -8,6 +8,7 @@ import pylint_cmk
pylint_cmk.ensure_equal_branches()
search_paths = [
+ "../lib",
"../bin",
"../notifications",
"../agents/plugins",