Do not update apt if devstack is in OFFLINE mode

Also, do not add trusty-backports repository if it already exists.

Change-Id: I24211458f32dc3895028f45b9cf26bc5a6fa0f3c
This commit is contained in:
Brandon Logan 2015-10-03 03:22:07 -05:00
parent 4ef9bb7ccd
commit eb2a61b4e9
1 changed files with 9 additions and 3 deletions

View File

@ -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