Adding logic to clean up old rally installs

Change-Id: Idee30bbeeb4d7b77b0ac2a0eb09ca56f2d7c488a
This commit is contained in:
rook 2014-10-14 16:05:09 -04:00
parent 3230a3a89b
commit 903b09b38b
2 changed files with 25 additions and 0 deletions

View File

@ -122,6 +122,27 @@ setup_virtualenv() {
source ${RALLY_VIRTUALENV_DIR}/bin/activate
}
remove_old_rally() {
cd ~
if [ $(which rally) ] ; then
RALLY=$(which rally)
fi
if [ $(which rally-manage) ] ; then
RALLYM=$(which rally-manage)
fi
rm -rf ${TMP}/rally.egg-info/ ${TMP}/build/ $RALLY $RALLYM
if [ ${RALLY_PATH=$(python -c "
import os,sys,imp;
print(
os.path.realpath(os.path.dirname(imp.find_module('rally',sys.path[1:])[1]
)))")} ] ; then
if [ -d "$RALLY_PATH/rally" ]; then
echo "Cleaning up $RALLY_PATH/rally..."
rm -rf $RALLY_PATH/rally
fi
fi
}
install_rally_requirements() {
pip install pbr
pip install 'tox<=1.6.1'
@ -169,6 +190,7 @@ main() {
install_system_requirements
if [ "${scope}" = "isolated" ]; then setup_virtualenv; fi
install_rally_requirements
remove_old_rally
install_rally
configure_rally
if [ "${scope}" = "isolated" ]; then print_virtualenv_notice; fi

View File

@ -16,5 +16,8 @@
# under the License.
sudo ./install_rally.sh
rally deployment list
sudo ./install_rally.sh
rally deployment list