stx-puppet: workaround to ignore known errors 56/8156/1
authorJackie Huang <jackie.huang@windriver.com>
Tue, 3 Nov 2020 08:13:10 +0000 (16:13 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Thu, 5 May 2022 12:33:56 +0000 (20:33 +0800)
Add a workaround in puppet-manifest-apply to ignore known
errors in puppet log so the puppet manifest can complete.

The "remount /scratch" error is known to be harmless so
add it to be ignored.

Issue-ID: INF-215

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I916511a8dfdb0a4a26bceeb4fd3e50d91fea7747

meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch [new file with mode: 0644]
meta-starlingx/meta-stx-cloud/recipes-support/puppet/stx-puppet_git.bb

diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch
new file mode 100644 (file)
index 0000000..a351c8a
--- /dev/null
@@ -0,0 +1,42 @@
+From 1735d6504b319c2d05ffbd2ae8ff6a4515982aed Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Sun, 19 Apr 2020 21:38:59 +0800
+Subject: [PATCH] puppet-manifest-apply: workaround to ignore known errors
+
+puppet-manifest-apply.sh will exit if there is any ERROR message in the
+puppet log, but the "remount /scratch" error is known to be harmless
+and the mount point is actually mounted succesfully, so add a workaround
+to ignore known errors in the log so the puppet manifest can complete.
+
+Upstream-Status: Inappropriate [workaround]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ puppet-manifests/src/bin/puppet-manifest-apply.sh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/puppet-manifests/src/bin/puppet-manifest-apply.sh b/puppet-manifests/src/bin/puppet-manifest-apply.sh
+index 18eec2c..3ac6cfc 100755
+--- a/puppet-manifests/src/bin/puppet-manifest-apply.sh
++++ b/puppet-manifests/src/bin/puppet-manifest-apply.sh
+@@ -89,6 +89,8 @@ function finish {
+ }
+ trap finish EXIT
+
++# Pattern for know errors, will be ignored when checking errors
++KNOWN_ERRORS="Error.*remount /scratch"
+
+ # Set Keystone endpoint type to internal to prevent SSL cert failures during config
+ export OS_ENDPOINT_TYPE=internalURL
+@@ -105,7 +107,7 @@ if [ $? -ne 0 ]; then
+     echo "See ${LOGFILE} for details"
+     exit 1
+ else
+-    grep -qE '^(.......)?Error|^....-..-..T..:..:..([.]...)?(.......)?.Error' ${LOGFILE}
++    grep -E -v "${KNOWN_ERRORS}" ${LOGFILE} | grep -qE '^(.......)?Error|^....-..-..T..:..:..([.]...)?(.......)?.Error'
+     if [ $? -eq 0 ]; then
+         echo "[ERROR]"
+         echo "Errors found. See ${LOGFILE} for details"
+--
+2.7.4
+
index 3f76a46..e00a952 100644 (file)
@@ -37,6 +37,7 @@ SRC_URI = " \
        file://${BPN}/0007-puppet-manifests-etcd-override-typo-and-journalctl.patch \
        file://${BPN}/0008-puppet-manifests-keystone-include-platform-client.patch \
        file://${BPN}/0009-puppet-manifests-lvm-remove-lvmetad.patch \
+       file://${BPN}/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch \
        file://${BPN}/get-boot-device-from-cmdline.patch \
        file://${BPN}/poky-specific-apply-network-config-script.patch \
        file://${BPN}/apply_network_config_poky.sh \