Module: check_mk
Branch: master
Commit: 3af53ac21122eb7a004be5e7a3543edf293a8134
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3af53ac21122eb…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Apr 24 12:51:34 2017 +0200
Fix the fix for races conditions.
Change-Id: If37cf1fd9d1114bbaf5d3a9a11b41eb465054b2e
---
modules/check_mk_base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 30f13a2..00b5861 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -55,6 +55,7 @@ import subprocess
from cmk.exceptions import MKGeneralException, MKTerminate
from cmk.regex import regex
+import cmk.store as store
import cmk.tty as tty
import cmk.render as render
import cmk.crash_reporting as crash_reporting
@@ -483,8 +484,7 @@ def store_persisted_info(hostname, persisted):
os.makedirs(dirname)
file_path = "%s/%s" % (dirname, hostname)
- file("%s.#new" % file_path, "w").write("%r\n" %
persisted)
- os.rename("%s.#new" % file_path, file_path)
+ store.save_data_to_file(file_path, persisted, pretty=False)
console.verbose("Persisted sections %s.\n" % ",
".join(persisted.keys()))