From 027a116c43284595df052bed9c5fadc93230bb60 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Mon, 8 Sep 2014 13:57:53 +0200 Subject: [PATCH] labs: disable cloud-archive for trusty Icehouse packages are part of Ubuntu 14.04 LTS (trusty), trying to add the cloud-archive results in an error. The code is still needed for precise (Ubuntu 12.04) and presumably for trusty once Juno and later OpenStack releases become available. Change-Id: I970f938281f0abfc32a3e0c1467c2dca11dfa676 --- labs/scripts/apt_init.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/labs/scripts/apt_init.sh b/labs/scripts/apt_init.sh index 69eecca6..0b416eb0 100755 --- a/labs/scripts/apt_init.sh +++ b/labs/scripts/apt_init.sh @@ -34,14 +34,21 @@ set_apt_proxy # Get apt index files sudo apt-get update -# cloud-keyring to verify packages from ubuntu-cloud repo -sudo apt-get install ubuntu-cloud-keyring +function ubuntu_cloud_archive { + # cloud-keyring to verify packages from ubuntu-cloud repo + sudo apt-get install ubuntu-cloud-keyring -# Install packages needed for add-apt-repository -sudo apt-get -y install software-properties-common python-software-properties -sudo add-apt-repository -y "cloud-archive:$OPENSTACK_RELEASE" + # Install packages needed for add-apt-repository + sudo apt-get -y install software-properties-common \ + python-software-properties + sudo add-apt-repository -y "cloud-archive:$OPENSTACK_RELEASE" -# Get index files only for ubuntu-cloud repo but keep standard lists -sudo apt-get update \ - -o Dir::Etc::sourcelist="sources.list.d/cloudarchive-$OPENSTACK_RELEASE.list" \ - -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + # Get index files only for ubuntu-cloud repo but keep standard lists + sudo apt-get update \ + -o Dir::Etc::sourcelist="sources.list.d/cloudarchive-$OPENSTACK_RELEASE.list" \ + -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" +} + +if grep -qs DISTRIB_CODENAME=precise /etc/lsb-release; then + ubuntu_cloud_archive +fi