From eb2a61b4e9082f97d3bc5c8ec9d02d29914e68a7 Mon Sep 17 00:00:00 2001 From: Brandon Logan Date: Sat, 3 Oct 2015 03:22:07 -0500 Subject: [PATCH] Do not update apt if devstack is in OFFLINE mode Also, do not add trusty-backports repository if it already exists. Change-Id: I24211458f32dc3895028f45b9cf26bc5a6fa0f3c --- devstack/plugin.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 97ba3371b..ef68688d6 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -7,9 +7,15 @@ function neutron_lbaas_install { function neutron_agent_lbaas_install_agent_packages { if is_ubuntu; then - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" -y - sudo apt-get update - sudo apt-get install haproxy -t trusty-backports + if [[ ${OFFLINE} == false ]]; then + BACKPORT="deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" + BACKPORT_EXISTS=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "${BACKPORT}") + if [[ -z "${BACKPORT_EXISTS}" ]]; then + sudo add-apt-repository "${BACKPORT}" -y + fi + sudo apt-get update + sudo apt-get install haproxy -t trusty-backports + fi fi if is_fedora || is_suse; then install_package haproxy