From 5b3c4dffbe0711bb6fcd28145d272918ca8dc04a Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Wed, 12 Jul 2017 21:13:28 +0200 Subject: [PATCH] Ensure yum cache is ready before update To workaround yum bug with libnss we need to make yum cache before running update. In fact we should have done this regardless of the bug. Change-Id: I5b2355fb8abe3c8d4b9ce9c62b9ffdba8c1e8d9d Resolves: rhbz#1458841 Closes-Bug: #1703830 (cherry picked from commit 1a544f66a51579180ead9deadc168d2a1a200719) (cherry picked from commit 7d5929f5bac86d877591f2acb14cfad730b19609) --- extraconfig/tasks/pacemaker_common_functions.sh | 2 ++ extraconfig/tasks/yum_update.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/extraconfig/tasks/pacemaker_common_functions.sh b/extraconfig/tasks/pacemaker_common_functions.sh index 1fe4784b68..adf24e735e 100755 --- a/extraconfig/tasks/pacemaker_common_functions.sh +++ b/extraconfig/tasks/pacemaker_common_functions.sh @@ -301,6 +301,8 @@ function systemctl_swift { # Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205 # Update condition and add --notriggerun for +bug/1669714 function special_case_ovs_upgrade_if_needed { + # Always ensure yum has full cache + yum makecache || echo "Yum makecache failed. This can cause failure later on." if rpm -qa | grep "^openvswitch-2.5.0-14" || rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart" ; then echo "Manual upgrade of openvswitch - ovs-2.5.0-14 or restart in postun detected" rm -rf OVS_UPGRADE diff --git a/extraconfig/tasks/yum_update.sh b/extraconfig/tasks/yum_update.sh index 885138a92f..43fbae220b 100755 --- a/extraconfig/tasks/yum_update.sh +++ b/extraconfig/tasks/yum_update.sh @@ -44,6 +44,9 @@ fi command_arguments=${command_arguments:-} +# Always ensure yum has full cache +yum makecache || echo "Yum makecache failed. This can cause failure later on." + # yum check-update exits 100 if updates are available set +e check_update=$(yum check-update 2>&1)