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/lib/ceilometer b/lib/ceilometer
index 0fae397..41a5f53 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -40,7 +40,7 @@
if [ -d $CEILOMETER_DIR/bin ] ; then
CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
else
- CEILOMETER_BIN_DIR=/usr/local/bin
+ CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
fi
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
diff --git a/lib/cinder b/lib/cinder
index 5f4f979..28b3caa 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -47,7 +47,7 @@
if [[ -d $CINDER_DIR/bin ]]; then
CINDER_BIN_DIR=$CINDER_DIR/bin
else
- CINDER_BIN_DIR=/usr/local/bin
+ CINDER_BIN_DIR=$(get_python_exec_prefix)
fi
# Name of the lvm volume group to use/create for iscsi volumes
diff --git a/lib/glance b/lib/glance
index 1c56a67..5d48129 100644
--- a/lib/glance
+++ b/lib/glance
@@ -44,7 +44,7 @@
if [[ -d $GLANCE_DIR/bin ]]; then
GLANCE_BIN_DIR=$GLANCE_DIR/bin
else
- GLANCE_BIN_DIR=/usr/local/bin
+ GLANCE_BIN_DIR=$(get_python_exec_prefix)
fi
# Glance connection info. Note the port must be specified.
diff --git a/lib/nova b/lib/nova
index 7e5bb99..4116278 100644
--- a/lib/nova
+++ b/lib/nova
@@ -49,7 +49,7 @@
if [[ -d $NOVA_DIR/bin ]]; then
NOVA_BIN_DIR=$NOVA_DIR/bin
else
- NOVA_BIN_DIR=/usr/local/bin
+ NOVA_BIN_DIR=$(get_python_exec_prefix)
fi
# Set the paths of certain binaries