Merge "cleanup potentially installed older oslo.config"
diff --git a/clean.sh b/clean.sh
index 493c449..f7d15df 100755
--- a/clean.sh
+++ b/clean.sh
@@ -56,6 +56,7 @@
 fi
 
 # Clean projects
+cleanup_oslo
 cleanup_cinder
 cleanup_glance
 cleanup_keystone
diff --git a/lib/oslo b/lib/oslo
index 1eb13db..de5ec4e 100644
--- a/lib/oslo
+++ b/lib/oslo
@@ -27,6 +27,10 @@
 
 # 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 @@
     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