Module: check_mk
Branch: master
Commit: 48a20ff4676976e5f2166b2aac3df7d54b81f94b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=48a20ff4676976…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Feb 6 16:53:06 2018 +0100
Fixed handling of another numeration format
Change-Id: Id8d05793ada41f6b6781bbab405080a008a604f9
---
cmk/structured_data.py | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/cmk/structured_data.py b/cmk/structured_data.py
index af36fa2..52caf71 100644
--- a/cmk/structured_data.py
+++ b/cmk/structured_data.py
@@ -194,10 +194,15 @@ class StructuredDataTree(object):
# In the second case we have to deal with nested numerations
# We take a look at children which may be real numerations
# or sub trees.
- if self._is_numeration(v):
+ # May also be a flat list, thus we convert to expected
+ # numeration format: [{KEY: VAL,..},..]
+ entries_type = self._get_entries_type(v)
+ if isinstance(entries_type, Numeration):
sub_raw_tree.setdefault(k, v)
- else:
+ elif isinstance(entries_type, Container):
sub_raw_tree.setdefault(k, dict(enumerate(v)))
+ else:
+ sub_raw_tree.setdefault(k, [{"name": e} for e in v])
else:
# Here we collect all other values meaning simple
# attributes of this node.
@@ -205,12 +210,15 @@ class StructuredDataTree(object):
return sub_raw_tree, leaf_data
- def _is_numeration(self, entries):
+ def _get_entries_type(self, entries):
+ #TODO test
for entry in entries:
+ if not isinstance(entry, dict):
+ return
for k, v in entry.iteritems():
if isinstance(v, list):
- return False
- return True
+ return Container()
+ return Numeration()
# ---delegators-----------------------------------------------------------
Module: check_mk
Branch: master
Commit: 05c1bb5ee71c26d32d4f7d13ce44d9ce7306431c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=05c1bb5ee71c26…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Feb 2 13:46:36 2018 +0100
Use bionic (Ubuntu 18.04) for Windows agent chroot
bionic provides mingw-w64 5.0.3-1 that is based on gcc 7.2.0 which
supports C++17
---
agents/windows/chroot_version | 2 +-
agents/windows/make-chroot | 15 ++++++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/agents/windows/chroot_version b/agents/windows/chroot_version
index 45a4fb7..ec63514 100644
--- a/agents/windows/chroot_version
+++ b/agents/windows/chroot_version
@@ -1 +1 @@
-8
+9
diff --git a/agents/windows/make-chroot b/agents/windows/make-chroot
index 1214319..e7a5d15 100755
--- a/agents/windows/make-chroot
+++ b/agents/windows/make-chroot
@@ -4,7 +4,7 @@
set -e
-DISTRO=artful
+DISTRO=bionic
MIRROR=http://de.archive.ubuntu.com/ubuntu
export HOSTNAME=cmk-windows-agent-chroot
@@ -112,7 +112,10 @@ package_names=(
python2.7
ssh-askpass
uuid-dev
- wine-stable
+# TODO: Need to install wine separately in order to use --force-overwrite, see
+# https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1725928/
+# Cannot pass --force-overwrite through debootstrap.
+# wine-stable
)
packages=$(IFS=,; echo "${package_names[*]}")
@@ -122,6 +125,12 @@ debootstrap \
--include="$packages" \
--arch amd64 $DISTRO $CHROOT_PATH $MIRROR
+# Cope with the known bug with libsane1 that wine depends on.
+# https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1725928/
+# Need to use --force-overwrite with apt-get. This option cannot be passed
+# through debootstrap.
+$SCRIPT_DIR/do-chroot 'apt-get -y -o Dpkg::Options::="--force-overwrite" install wine-stable'
+
# Need to be installed for installation.
cat <<EOF > $CHROOT_PATH/etc/fstab
# created by make-chroot
@@ -161,7 +170,7 @@ fi
sed -ri 's/^_apt:x:[0-9]+:/_apt:x:0:/g' $CHROOT_PATH/etc/passwd
# We need to enable 32bit Wine
-$SCRIPT_DIR/do-chroot "dpkg --add-architecture i386 && apt-get update && apt-get -y install wine32"
+$SCRIPT_DIR/do-chroot 'dpkg --add-architecture i386 && apt-get update && apt-get -o Dpkg::Options::="--force-overwrite" -y install wine32'
# Build Google Test and Google Mock
$SCRIPT_DIR/do-chroot "$CHROOT_BUILD_DIR/agents/windows/test/build-googletest"
Module: check_mk
Branch: master
Commit: d35050f7ec1024be2953ee027d1a14d0dd836263
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d35050f7ec1024…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Tue Feb 6 16:15:49 2018 +0100
Re-enable parallel build for Googletest
This should reduce chroot setup time at least a bit. The output of
single build steps will be separated from each other, so the build
output should remain readable even if run in parallel - in the rare
case someone would still like to read it.
---
agents/windows/test/build-googletest | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/agents/windows/test/build-googletest b/agents/windows/test/build-googletest
index caa90d7..fba94c3 100755
--- a/agents/windows/test/build-googletest
+++ b/agents/windows/test/build-googletest
@@ -23,9 +23,17 @@ for project in test mock ; do
# we only need the libs...
targets=lib/libg${project}.la
autoreconf --install
+ # Build 32 and 64 bit in parallel, wait for child processes to terminate.
+ children=()
for arch in 32 64 ; do
- build $arch
+ build $arch &
+ children+=($!)
done
+ for pid in "${children[@]}" ; do
+ # If any subprocess fails, wait for the rest to exit in a controlled way.
+ wait $pid || { wait; exit 1; }
+ done
+
# make install is not supported by Google -> copy headers and libs
cp -r include/g${project} /usr/share/mingw-w64/include/
for arch in 32 64 ; do
Module: check_mk
Branch: master
Commit: 91a5cc39a69011b1c206957c2b509ba8ce30d083
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91a5cc39a69011…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Tue Feb 6 16:10:19 2018 +0100
Windows: fix typo in chroot setup progress info
---
agents/windows/make-agent | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/windows/make-agent b/agents/windows/make-agent
index 5b28a31..f2f077d 100755
--- a/agents/windows/make-agent
+++ b/agents/windows/make-agent
@@ -53,7 +53,7 @@ echo "CHROOT_PATH is $CHROOT_PATH"
# created, multiple jobs may be executed in the chroot simultaneously,
# but the setup must be performed only by a single job.
(
- echo "[MAKE-CHROOT LOCK] aquire"
+ echo "[MAKE-CHROOT LOCK] acquire"
flock -x -w 1800 200 || (echo "[MAKE-CHROOT LOCK] ERROR: Failed to get lock within 1800 seconds" ; exit 1)
echo "[MAKE-CHROOT LOCK] got it"