Created
February 13, 2014 18:44
-
-
Save anonymous/8981228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function white { | |
echo -e "\033[37m$1\033[0m" | |
} | |
function red { | |
echo -e "\033[31m$1\033[0m" | |
} | |
if ! which pip; then | |
white 'pip not found. Attempting to install it...' | |
sudo easy_install pip | |
fi | |
INSTALL_TEMP=`mktemp -d ${TMPDIR}openstacktoolsetXXXXXX` | |
pushd $INSTALL_TEMP > /dev/null | |
white 'Installing pbr...' | |
git clone git://github.com/openstack-dev/pbr.git > /dev/null | |
pushd pbr | |
sudo python setup.py install > /dev/null | |
popd | |
clients=(cinder glance heat keystone neutron nova swift) | |
for c in ${clients[@]}; do | |
white "Installing ${c}..." | |
git clone git://github.com/openstack/python-${c}client.git > /dev/null | |
pushd python-${c}client | |
sudo python setup.py install > /dev/null | |
popd | |
done | |
popd $INSTALL_TEMP | |
sudo rm -rf $INSTALL_TEMP | |
error=0 | |
vars=(OS_TENANT_NAME OS_USERNAME OS_PASSWORD OS_AUTH_URL OS_NO_CACHE OS_SERVICE_TOKEN SERVICE_ENDPOINT) | |
for v in ${vars[@]}; do | |
value=$(env | grep $v | cut -f 2- -d '=') | |
if [ -z "$value" ]; then | |
red "$v is not set" | |
error=1 | |
fi | |
done | |
if [ $error -eq 0 ]; then | |
white "All RLPC environment variables defined" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment