From: Markos Chandras Date: Tue, 27 Feb 2018 12:10:17 +0000 (+0000) Subject: xci: scripts: start-new-vm: Mask the pgrep exit code X-Git-Tag: 6.0.0~146 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F52735%2F1;p=releng-xci.git xci: scripts: start-new-vm: Mask the pgrep exit code pgrep will exit with non-zero exit code if it didn't find a matching process. This breaks the script since we set 'errexit' so we need to mask it by simply piping it to a 'cat' command. Change-Id: I80dcf06b597a769242bd59d628bbd8e09f0f199e Signed-off-by: Markos Chandras --- diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index 5f7fe590..f53ec5ef 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -127,7 +127,7 @@ esac echo "Checking for running package manager instance..." while true; do - _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}") + _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}" | cat) if [[ -n ${_pkg_mgr_proc} ]]; then echo "Wainting for process ${_pkg_mgr_proc} to finish..." sleep 60