Introduce get_python_exec_prefix function.

get_python_exec_prefix returns the path to the direcotry where python
executables are installed, that is /usr/bin on Fedora and /usr/local/bin
everywhere else.

It is used to properly locate OpenStack executables.

Fixes: bug #1068386

Change-Id: I228498ebe2762568d00757d065e37377ee2c8fb3
diff --git a/functions b/functions
index 7948378..68aec5d 100644
--- a/functions
+++ b/functions
@@ -1110,17 +1110,23 @@
 }
 
 
+# Get the path to the direcotry where python executables are installed.
+# get_python_exec_prefix
+function get_python_exec_prefix() {
+    if is_fedora; then
+        echo "/usr/bin"
+    else
+        echo "/usr/local/bin"
+    fi
+}
+
 # Get the location of the $module-rootwrap executables, where module is cinder
 # or nova.
 # get_rootwrap_location module
 function get_rootwrap_location() {
     local module=$1
 
-    if is_fedora; then
-        echo "/usr/bin/$module-rootwrap"
-    else
-        echo "/usr/local/bin/$module-rootwrap"
-    fi
+    echo "$(get_python_exec_prefix)/$module-rootwrap"
 }
 
 # Get the path to the pip command.