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
This commit is contained in:
Ian Wienand 2016-02-29 15:15:39 +11:00
parent 80ea24cbbb
commit 3c60168532

View File

@ -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"