Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-support / puppet / files / stx-puppet / 0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch
1 From 1735d6504b319c2d05ffbd2ae8ff6a4515982aed Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Sun, 19 Apr 2020 21:38:59 +0800
4 Subject: [PATCH] puppet-manifest-apply: workaround to ignore known errors
5
6 puppet-manifest-apply.sh will exit if there is any ERROR message in the
7 puppet log, but the "remount /scratch" error is known to be harmless
8 and the mount point is actually mounted succesfully, so add a workaround
9 to ignore known errors in the log so the puppet manifest can complete.
10
11 Upstream-Status: Inappropriate [workaround]
12
13 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
14 ---
15  puppet-manifests/src/bin/puppet-manifest-apply.sh | 4 +++-
16  1 file changed, 3 insertions(+), 1 deletion(-)
17
18 diff --git a/puppet-manifests/src/bin/puppet-manifest-apply.sh b/puppet-manifests/src/bin/puppet-manifest-apply.sh
19 index 18eec2c..3ac6cfc 100755
20 --- a/puppet-manifests/src/bin/puppet-manifest-apply.sh
21 +++ b/puppet-manifests/src/bin/puppet-manifest-apply.sh
22 @@ -89,6 +89,8 @@ function finish {
23  }
24  trap finish EXIT
25
26 +# Pattern for know errors, will be ignored when checking errors
27 +KNOWN_ERRORS="Error.*remount /scratch"
28
29  # Set Keystone endpoint type to internal to prevent SSL cert failures during config
30  export OS_ENDPOINT_TYPE=internalURL
31 @@ -105,7 +107,7 @@ if [ $? -ne 0 ]; then
32      echo "See ${LOGFILE} for details"
33      exit 1
34  else
35 -    grep -qE '^(.......)?Error|^....-..-..T..:..:..([.]...)?(.......)?.Error' ${LOGFILE}
36 +    grep -E -v "${KNOWN_ERRORS}" ${LOGFILE} | grep -qE '^(.......)?Error|^....-..-..T..:..:..([.]...)?(.......)?.Error'
37      if [ $? -eq 0 ]; then
38          echo "[ERROR]"
39          echo "Errors found. See ${LOGFILE} for details"
40 --
41 2.7.4
42