devstack/lib/oslo
Alessio Ababilov c2a4c9238d Fix 'olso' typo in lib/oslo
This enables commit If92073be5a431840701c952a194e63a7c452c9ca
for cleaning up potentially installed older oslo.config. Here are
its original details.

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: I7fa0b70497bf5622f4638da284afe5363a004d3c
Fixes: bug #1213089
2013-08-16 21:57:20 +03:00

58 lines
1.3 KiB
Plaintext

# lib/oslo
#
# Functions to install oslo libraries from git
#
# We need this to handle the fact that projects would like to use
# pre-released versions of oslo libraries.
# Dependencies:
# ``functions`` file
# ``stack.sh`` calls the entry points in this order:
#
# install_oslo
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
OSLOCFG_DIR=$DEST/oslo.config
OSLOMSG_DIR=$DEST/oslo.messaging
# Entry Points
# ------------
# 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
git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
setup_develop $OSLOMSG_DIR
}
# cleanup_oslo() - purge possibly old versions of oslo
function cleanup_oslo() {
# this means we've got an old oslo installed, lets get rid of it
if ! python -c 'import oslo.config' 2>/dev/null; then
echo "Found old oslo.config... removing to ensure consistency"
local PIP_CMD=$(get_pip_command)
pip_install oslo.config
sudo $PIP_CMD uninstall -y oslo.config
fi
}
# Restore xtrace
$XTRACE
# Local variables:
# mode: shell-script
# End: