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
| ... | ... |
@@ -1304,15 +1304,16 @@ function yum_install {
|
| 1304 | 1304 |
|
| 1305 | 1305 |
# Warning: this would not work if yum output message |
| 1306 | 1306 |
# have been translated to another language |
| 1307 |
- parse_yum_result='\ |
|
| 1308 |
- BEGIN { result=0 }\
|
|
| 1309 |
- /^YUM_FAILED/ { exit $2 }\
|
|
| 1310 |
- /^No package/ { result=1 }\
|
|
| 1311 |
- //{ print }\
|
|
| 1307 |
+ parse_yum_result=' \ |
|
| 1308 |
+ BEGIN { result=0 } \
|
|
| 1309 |
+ /^YUM_FAILED/ { exit $2 } \
|
|
| 1310 |
+ /^No package/ { result=1 } \
|
|
| 1311 |
+ /^Failed:/ { result=1 } \
|
|
| 1312 |
+ //{ print } \
|
|
| 1312 | 1313 |
END { exit result }'
|
| 1313 | 1314 |
|
| 1314 | 1315 |
# The manual check for missing packages is because yum -y assumes |
| 1315 |
- # missing packages are OK. |
|
| 1316 |
+ # missing or failed packages are OK. |
|
| 1316 | 1317 |
# See https://bugzilla.redhat.com/show_bug.cgi?id=965567 |
| 1317 | 1318 |
(sudo_with_proxies "${YUM:-yum}" install -y "$@" 2>&1 || echo YUM_FAILED $?) \
|
| 1318 | 1319 |
| awk "$parse_yum_result" |