Browse code

Merge "cleanup potentially installed older oslo.config"

Jenkins authored on 2013/08/10 10:14:08
Showing 2 changed files
... ...
@@ -56,6 +56,7 @@ if [[ -n "$SESSION" ]]; then
56 56
 fi
57 57
 
58 58
 # Clean projects
59
+cleanup_oslo
59 60
 cleanup_cinder
60 61
 cleanup_glance
61 62
 cleanup_keystone
... ...
@@ -27,6 +27,10 @@ OSLOMSG_DIR=$DEST/oslo.messaging
27 27
 
28 28
 # install_oslo() - Collect source and prepare
29 29
 function install_oslo() {
30
+    # TODO(sdague): remove this once we get to Icehouse, this just makes
31
+    # for a smoother transition of existing users.
32
+    cleanup_oslo
33
+
30 34
     git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
31 35
     setup_develop $OSLOCFG_DIR
32 36
 
... ...
@@ -34,6 +38,17 @@ function install_oslo() {
34 34
     setup_develop $OSLOMSG_DIR
35 35
 }
36 36
 
37
+# cleanup_oslo() - purge possibly old versions of oslo
38
+function cleanup_oslo() {
39
+    # this means we've got an old olso installed, lets get rid of it
40
+    if find /usr | grep oslo.config | grep -v oslo.config.egg-link > /dev/null; then
41
+        echo "Found old oslo.config... removing to ensure consistency"
42
+        local PIP_CMD=$(get_pip_command)
43
+        pip_install olso.config
44
+        sudo $PIP_CMD uninstall -y olso.config
45
+    fi
46
+}
47
+
37 48
 # Restore xtrace
38 49
 $XTRACE
39 50