Module: check_mk
Branch: master
Commit: 9ac380fd0419527cc4b09bc505c5957e83d0391c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9ac380fd041952…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 2 14:58:16 2017 +0200
Store: Fixed useless two times read of file in load_data_from_file()
Change-Id: Iaab5747a3b20d817e71ae57007309a25750ca9de
---
lib/store.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/store.py b/lib/store.py
index 08300f0..f88545d 100644
--- a/lib/store.py
+++ b/lib/store.py
@@ -116,7 +116,7 @@ def load_data_from_file(path, default=None, lock=False):
# May be created empty during locking
return default
else:
- return ast.literal_eval(file(path).read())
+ return ast.literal_eval(content)
except IOError, e:
if e.errno == 2: # IOError: [Errno 2] No such file or directory
return default