don't use pip -e install for libraries

libraries in openstack shouldn't be installed editable, as it
causes all manner of issues (especially complicated by the use
of namespace packages). Install these globally as part of the
devstack installation process.

Change-Id: I11acb169e74069be0618e57496ff342f9e788493
diff --git a/functions-common b/functions-common
index e6caaa3..6340c5c 100644
--- a/functions-common
+++ b/functions-common
@@ -1239,6 +1239,19 @@
         && $SUDO_PIP rm -rf ${pip_build_tmp}
 }
 
+# this should be used if you want to install globally, all libraries should
+# use this, especially *oslo* ones
+function setup_install {
+    local project_dir=$1
+    setup_package_with_req_sync $project_dir
+}
+
+# this should be used for projects which run services, like all services
+function setup_develop {
+    local project_dir=$1
+    setup_package_with_req_sync $project_dir -e
+}
+
 # ``pip install -e`` the package, which processes the dependencies
 # using pip before running `setup.py develop`
 #
@@ -1247,8 +1260,9 @@
 #
 # Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``, ``UNDO_REQUIREMENTS``
 # setup_develop directory
-function setup_develop {
+function setup_package_with_req_sync {
     local project_dir=$1
+    local flags=$2
 
     # Don't update repo if local changes exist
     # Don't use buggy "git diff --quiet"
@@ -1260,7 +1274,7 @@
             $SUDO_CMD python update.py $project_dir)
     fi
 
-    setup_develop_no_requirements_update $project_dir
+    setup_package $project_dir $flags
 
     # We've just gone and possibly modified the user's source tree in an
     # automated way, which is considered bad form if it's a development
@@ -1281,12 +1295,15 @@
 # using pip before running `setup.py develop`
 # Uses globals ``STACK_USER``
 # setup_develop_no_requirements_update directory
-function setup_develop_no_requirements_update {
+function setup_package {
     local project_dir=$1
+    local flags=$2
 
-    pip_install -e $project_dir
+    pip_install $flags $project_dir
     # ensure that further actions can do things like setup.py sdist
-    safe_chown -R $STACK_USER $1/*.egg-info
+    if [[ "$flags" == "-e" ]]; then
+        safe_chown -R $STACK_USER $1/*.egg-info
+    fi
 }