Module: check_mk
Branch: master
Commit: ec8a3f7b7cc1c76fcaa0f8495d6c1ef62e5b6110
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec8a3f7b7cc1c7…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Jul 14 10:23:08 2016 +0200
password store is now pretty-printed and uses the file extension .json to avoid confusion
---
lib/passwordstore.py | 2 +-
web/htdocs/valuespec.py | 2 +-
web/plugins/userdb/hook_auth.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/passwordstore.py b/lib/passwordstore.py
index 40a6b57..a1b27c8 100644
--- a/lib/passwordstore.py
+++ b/lib/passwordstore.py
@@ -334,7 +334,7 @@ class ChangeContext(object):
if 'secrets' not in self.__data:
self.__data['secrets'] = {}
with NamedTemporaryFile(dir=os.path.dirname(self.__filename), delete=False)
as f:
- json.dump(self.__data, f)
+ json.dump(self.__data, f, indent=4)
os.rename(f.name, self.__filename)
fcntl.flock(self.__fd, fcntl.LOCK_UN)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index f74df9c..7a2aba8 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -3384,7 +3384,7 @@ class PasswordFromStore(Alternative):
# TODO: we can't limit the view to only the passwords accessible by the user
because at
# this point the user_id has not been set yet
- with PasswordStore(defaults.var_dir + "/passwords.mk", backend) as
store:
+ with PasswordStore(defaults.var_dir + "/passwords.json", backend) as
store:
return store.list(with_details=True)
def matching_alternative(self, value):
diff --git a/web/plugins/userdb/hook_auth.py b/web/plugins/userdb/hook_auth.py
index 0f779f5..6d9479d 100644
--- a/web/plugins/userdb/hook_auth.py
+++ b/web/plugins/userdb/hook_auth.py
@@ -66,7 +66,7 @@ import errno
g_auth_base_dir = defaults.var_dir + '/wato/auth'
g_keys_dir = defaults.var_dir + '/private_keys'
-g_passwords_file = defaults.var_dir + '/passwords.mk'
+g_passwords_file = defaults.var_dir + '/passwords.json'
def format_php(data, lvl = 1):