Module: check_mk
Branch: master
Commit: cc2c04415137409114037e3f16ac296d17508523
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cc2c0441513740…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 30 09:32:18 2017 +0200
Cleaned up useless user name lookup from exception handling
Change-Id: I4f418898466b27aa5f046a908028f8321a3f5e21
---
modules/check_mk_base.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 34e116a..7e08189 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1038,9 +1038,7 @@ def save_item_state(hostname):
os.makedirs(cmk.paths.counters_dir)
file(filename, "w").write("%r\n" % g_item_state)
except Exception, e:
- import pwd
- username = pwd.getpwuid(os.getuid())[0]
- raise MKGeneralException("User %s cannot write to %s: %s" %
(username, filename, e))
+ raise MKGeneralException("Cannot write to %s: %s" % (filename,
traceback.format_exc()))
# Store arbitrary values until the next execution of a check