From 3c60168532b9202baa6d163d3501d8323239eb5b Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 29 Feb 2016 15:15:39 +1100 Subject: [PATCH] Also detected failed packages in dnf/yum wrapper As seen in [1]; dnf can output a "Failed:" section when installation issues with a package are detected. This does not, however, trigger an exit failure code when running with "-y". So add this to our checking wrapper. [1] http://logs.openstack.org/49/280449/1/check/gate-tempest-dsvm-platform-fedora23-nv/dc70ca8/logs/devstacklog.txt.gz#_2016-02-28_22_42_45_145 Change-Id: I12f7b3bc9e9cf5a97114082d3a634a42742843d5 --- functions-common | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/functions-common b/functions-common index ed444bbd41..2b23402b54 100644 --- a/functions-common +++ b/functions-common @@ -1304,15 +1304,16 @@ function yum_install { # Warning: this would not work if yum output message # have been translated to another language - parse_yum_result='\ - BEGIN { result=0 }\ - /^YUM_FAILED/ { exit $2 }\ - /^No package/ { result=1 }\ - //{ print }\ + parse_yum_result=' \ + BEGIN { result=0 } \ + /^YUM_FAILED/ { exit $2 } \ + /^No package/ { result=1 } \ + /^Failed:/ { result=1 } \ + //{ print } \ END { exit result }' # The manual check for missing packages is because yum -y assumes - # missing packages are OK. + # missing or failed packages are OK. # See https://bugzilla.redhat.com/show_bug.cgi?id=965567 (sudo_with_proxies "${YUM:-yum}" install -y "$@" 2>&1 || echo YUM_FAILED $?) \ | awk "$parse_yum_result"