From db5fadb5cb768820df54fc3d1c7428a57b511582 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 9 Aug 2013 13:41:33 -0400 Subject: [PATCH] cleanup potentially installed older oslo.config If the user had oslo.config installed prior to us setting up the oslo.config out of git they can get themselves into this very funny situation where pip doesn't see oslo.config 1.1.x, however some packages might. This manifests itself as a user error trying to start nova-api which uses DeprecatedOption, not in oslo.config 1.1.x Because of the funny state pip is in, you can't uninstall oslo.config. So in these situations, if we see old oslo.config in the filesystem, pip install / uninstall it to ensure that everyone ends up using the git version instead. To reduce the amount of user confusion, do this on every install_oslo for a while, which we can purge after Havana ships. Change-Id: If92073be5a431840701c952a194e63a7c452c9ca --- clean.sh | 1 + lib/oslo | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/clean.sh b/clean.sh index 493c449fca..f7d15dfe4e 100755 --- a/clean.sh +++ b/clean.sh @@ -56,6 +56,7 @@ if [[ -n "$SESSION" ]]; then fi # Clean projects +cleanup_oslo cleanup_cinder cleanup_glance cleanup_keystone diff --git a/lib/oslo b/lib/oslo index 1eb13dbf3d..de5ec4e83e 100644 --- a/lib/oslo +++ b/lib/oslo @@ -27,6 +27,10 @@ OSLOMSG_DIR=$DEST/oslo.messaging # install_oslo() - Collect source and prepare function install_oslo() { + # TODO(sdague): remove this once we get to Icehouse, this just makes + # for a smoother transition of existing users. + cleanup_oslo + git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH setup_develop $OSLOCFG_DIR @@ -34,6 +38,17 @@ function install_oslo() { setup_develop $OSLOMSG_DIR } +# cleanup_oslo() - purge possibly old versions of oslo +function cleanup_oslo() { + # this means we've got an old olso installed, lets get rid of it + if find /usr | grep oslo.config | grep -v oslo.config.egg-link > /dev/null; then + echo "Found old oslo.config... removing to ensure consistency" + local PIP_CMD=$(get_pip_command) + pip_install olso.config + sudo $PIP_CMD uninstall -y olso.config + fi +} + # Restore xtrace $XTRACE