Browse code

Faster old oslo.config detection

Just search in the path where python searches for modules.
Let's use python for searching, it knows the exact rules.

Change-Id: I659f734c418ab5e56f4956f418af48dfbe054c8a

Attila Fazekas authored on 2013/08/14 01:55:33
Showing 1 changed files
... ...
@@ -41,7 +41,7 @@ function install_oslo() {
41 41
 # cleanup_oslo() - purge possibly old versions of oslo
42 42
 function cleanup_oslo() {
43 43
     # this means we've got an old olso installed, lets get rid of it
44
-    if find /usr | grep oslo.config | grep -v oslo.config.egg-link > /dev/null; then
44
+    if ! python -c 'import oslo.config' 2>/dev/null; then
45 45
         echo "Found old oslo.config... removing to ensure consistency"
46 46
         local PIP_CMD=$(get_pip_command)
47 47
         pip_install olso.config