Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 70 lines (52 sloc) 1.86 KB
#!/usr/bin/env bash
# ``prep-work`` handles the preparations for installing and configuring
# the "work" configuration of DevStack.
# Keep track of the devstack directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $GRENADE_DIR/functions
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# System Preparation
# ==================
# Optimization for slow Internet
if [[ -d $WORK_DEVSTACK_DIR/files/images ]]; then
rsync -a $WORK_DEVSTACK_DIR/files/images $DEST
fi
# perform cleanup to ensure a clean starting environment
rm -rf $WORK_DEVSTACK_DIR
# check out devstack
git_clone $WORK_DEVSTACK_REPO $WORK_DEVSTACK_DIR $WORK_DEVSTACK_BRANCH
if [[ -d $DEST/images ]]; then
rsync -a $DEST/images $WORK_DEVSTACK_DIR/files
fi
# Set up localrc
cp -p $GRENADE_DIR/devstack.localrc.work $WORK_DEVSTACK_DIR/localrc
# clean up apache config
# essex devstack uses 000-default
# folsom devstack uses horizon -> ../sites-available/horizon
if [[ -e /etc/apache2/sites-enabled/horizon ]]; then
# Clean up folsom-style
sudo a2dissite horizon
sudo service apache2 reload
fi
# Essex-specific prep
if [[ "$START_RELEASE" == "essex" ]]; then
# python-glanceclient is new for Folsom; to roll back to Essex it
# must be removed and stable/essex restored in the glance repo
source $WORK_DEVSTACK_DIR/stackrc
[[ -d $GLANCECLIENT_DIR ]] && rm -rf $GLANCECLIENT_DIR
[[ -x /usr/local/bin/glance ]] && sudo rm /usr/local/bin/glance
pip freeze | grep -q python-glanceclient && sudo pip uninstall python-glanceclient
if [[ -d $GLANCE_DIR ]]; then
cd $GLANCE_DIR
git checkout $GLANCE_BRANCH
setup_develop $GLANCE_DIR
fi
fi