Module: check_mk
Branch: master
Commit: 41425f77bbbeb924789cedea3ec5febeca59817b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=41425f77bbbeb9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 2 13:25:14 2018 +0100
5874 FIX Improved diagnose logging for WATO integrated Git
Set the user interface logging to debug to get detailed information
about the WATO integrated git logic. The entries are written to
the var/log/web.log file.
Change-Id: I58c45c54a27646476217369dea83d1342e11c59f
---
.werks/5874 | 13 +++++++++++++
web/htdocs/watolib.py | 4 ++++
2 files changed, 17 insertions(+)
diff --git a/.werks/5874 b/.werks/5874
new file mode 100644
index 0000000..f0cae0c
--- /dev/null
+++ b/.werks/5874
@@ -0,0 +1,13 @@
+Title: Improved diagnose logging for WATO integrated Git
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i4
+Date: 1519993446
+
+Set the user interface logging to debug to get detailed information
+about the WATO integrated git logic. The entries are written to
+the var/log/web.log file.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index fbd77f9..66b8cde 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -9758,6 +9758,7 @@ def unlock_exclusive():
def git_command(args):
command = [ "git" ] + [ a.encode("utf-8") for a in args ]
+ logger.debug("GIT: Execute %s" % subprocess.list2cmdline(command))
try:
p = subprocess.Popen(command, cwd=cmk.paths.default_config_dir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -9783,6 +9784,7 @@ def do_git_commit():
author = "%s <%s>" % (config.user.id, config.user.email)
git_dir = cmk.paths.default_config_dir + "/.git"
if not os.path.exists(git_dir):
+ logger.debug("GIT: Initializing")
git_command(["init"])
# Set git repo global user/mail. seems to be needed to prevent warning message
@@ -9797,10 +9799,12 @@ def do_git_commit():
_("Initialized GIT for Check_MK")])
if git_has_pending_changes():
+ logger.debug("GIT: Found pending changes - Update gitignore file")
write_gitignore_files()
# Writing the gitignore files might have reverted the change. So better re-check.
if git_has_pending_changes():
+ logger.debug("GIT: Still has pending changes")
git_add_files()
message = ", ".join(g_git_messages)