From 311aff2fce97274455e8def5611c1d691650bbba Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 30 Jan 2015 15:07:52 -0800 Subject: [PATCH] Fix centos6 image updates on hpcloud The "yum repolist" command was failing with what I think was the same error that the update command was designed to fix. I am unsure how or if that ever worked correctly, or what might have changed to cause it to start impacting that command. At any rate, specifying "epel*" as the repo name to disable will cause the update command to work regardless of whether it is installed. Change-Id: I1d978ade76ec78e8895e00bbf64e5e40529223f8 --- nodepool/scripts/prepare_node.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nodepool/scripts/prepare_node.sh b/nodepool/scripts/prepare_node.sh index 9ca4dfe91d..49e741fa89 100755 --- a/nodepool/scripts/prepare_node.sh +++ b/nodepool/scripts/prepare_node.sh @@ -40,13 +40,10 @@ if [ -f /etc/redhat-release ]; then if grep -q 'CentOS release 6' /etc/redhat-release; then # chicken-and-egg ... hp cloud image has EPEL installed, but # we can't connect to it... - # However, if we're not on an hp cloud image, we may not have - # epel and --disablerepo will fail - if yum repolist | grep epel &> /dev/null ; then - sudo yum --disablerepo=epel update -y ca-certificates - else - sudo yum update -y ca-certificates - fi + # Note 'epel*' will match 0 or more repositories named epel, + # so it will work regardless of whether epel is actually + # installed. + sudo yum --disablerepo=epel* update -y ca-certificates fi fi