From ed9487a885caf81b9283f39702261d91c94ac393 Mon Sep 17 00:00:00 2001 From: "Davanum Srinivas (dims)" Date: Mon, 11 Jan 2016 21:20:34 +0000 Subject: [PATCH] Revert "Don't die when yum fails." This reverts commit 2babf3963f4eea8558b0c287c51e6faeb7069c70. This breaks oslo.messaging jobs: http://logs.openstack.org/32/265932/1/check/gate-oslo.messaging-dsvm-functional-amqp1-centos7/f5f3eb9/console.html#_2016-01-11_20_03_33_162 @kgiusti reports that PIPESTATUS[0] is always 1 on his centos7 box Change-Id: I013c22a3545f22c79a0616b4a98622d41bb17d77 --- functions-common | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/functions-common b/functions-common index dbf605cdd8..c6bf648511 100644 --- a/functions-common +++ b/functions-common @@ -1334,17 +1334,13 @@ function yum_install { BEGIN { fail=0 } /No package/ { fail=1 } { print } - END { exit fail }' - result=$? + END { exit fail }' || \ + die $LINENO "Missing packages detected" - if [ $result != 0 ]; then - echo $LINENO "Missing packages detected" - elif [[ ${PIPESTATUS[0]} != 0 ]]; then - # also ensure we catch a yum failure - echo $LINENO "${YUM:-yum} install failure" - result=1 + # also ensure we catch a yum failure + if [[ ${PIPESTATUS[0]} != 0 ]]; then + die $LINENO "${YUM:-yum} install failure" fi - return $result } # zypper wrapper to set arguments correctly