Module: check_mk
Branch: master
Commit: ef943a3afa0da8f56c4bdee56f71b8f17075d216
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ef943a3afa0da8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 3 11:35:02 2018 +0200
precompiling checks: Use standard store methods for writing file
Change-Id: I2fec7dfbc05cca420c3105f5bea1b1b4c3f2489a
---
cmk_base/checks.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmk_base/checks.py b/cmk_base/checks.py
index 5be485c..d639ea0 100644
--- a/cmk_base/checks.py
+++ b/cmk_base/checks.py
@@ -32,6 +32,7 @@ import marshal
from collections import OrderedDict
import cmk.paths
+import cmk.store as store
from cmk.exceptions import MKGeneralException, MKTerminate
import cmk_base
@@ -355,8 +356,7 @@ def _precompile_plugin(path, precompiled_path):
if not os.path.exists(os.path.dirname(precompiled_path)):
os.makedirs(os.path.dirname(precompiled_path))
- with open(precompiled_path, "w") as compiled_file:
- marshal.dump(code, compiled_file)
+ store.save_file(precompiled_path, marshal.dumps(code))
def _precompiled_plugin_path(path):