Module: check_mk
Branch: master
Commit: 70d1f37035aff2ede051b9ee65cb227204c0e8ed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70d1f37035aff2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 26 16:26:34 2017 +0200
4900 FIX Activate changes: Improved error reporting during activate changes
Change-Id: I3280f6be40f4ca4cb3c9754083955c1551122ba6
---
.werks/4900 | 11 +++++++++++
web/htdocs/multitar.py | 15 ++++++++++-----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.werks/4900 b/.werks/4900
new file mode 100644
index 0000000..5a4450f
--- /dev/null
+++ b/.werks/4900
@@ -0,0 +1,11 @@
+Title: Activate changes: Improved error reporting during activate changes
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498487162
+
+
diff --git a/web/htdocs/multitar.py b/web/htdocs/multitar.py
index 0c565ec..62cbd8f 100644
--- a/web/htdocs/multitar.py
+++ b/web/htdocs/multitar.py
@@ -59,11 +59,16 @@ def create(filename, components):
exclude_args = list(itertools.chain.from_iterable([ ("--exclude",
f) for f in excludes ]))
- subdata = subprocess.check_output(
- [ "tar", "cf", "-",
"--force-local" ]
- + exclude_args
- + [ "-C", basedir, filename ]
- )
+ cmd = [ "tar", "cf", "-",
"--force-local" ] \
+ + exclude_args \
+ + [ "-C", basedir, filename ]
+
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ subdata, stderr = p.communicate()
+
+ if p.returncode != 0:
+ raise MKGeneralException("Failed to create tar: %s\nExit code:
%d\nOutput: %s" %
+ (subprocess.list2cmdline(cmd), p.returncode, stderr))
info = tarfile.TarInfo(subtarname)
info.mtime = time.time()