Support the possibility of using entry-points.
If console scripts are generated via entry-points, they will go into
/usr/local/bin on python setup.py develop and they will not be found in
/opt/stack/$PROJECT/bin any more. This patch supports a transition to
entry-points console scripts, but should still allow the old thing too.
Change-Id: I816f5f796ad00ac55a8352743ba01723df140072
diff --git a/lib/cinder b/lib/cinder
index 796c107..525b6c6 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -25,6 +25,11 @@
# set up default directories
CINDER_DIR=$DEST/cinder
+if [ -d $CINDER_DIR/bin ] ; then
+ CINDER_BIN_DIR=$CINDER_DIR/bin
+else
+ CINDER_BIN_DIR=/usr/local/bin
+fi
CINDERCLIENT_DIR=$DEST/python-cinderclient
CINDER_CONF_DIR=/etc/cinder
CINDER_CONF=$CINDER_CONF_DIR/cinder.conf
@@ -134,7 +139,7 @@
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE cinder;'
# (re)create cinder database
- $CINDER_DIR/bin/cinder-manage db sync
+ $CINDER_BIN_DIR/cinder-manage db sync
fi
if is_service_enabled c-vol; then
@@ -198,9 +203,9 @@
fi
fi
- screen_it c-api "cd $CINDER_DIR && $CINDER_DIR/bin/cinder-api --config-file $CINDER_CONF"
- screen_it c-vol "cd $CINDER_DIR && $CINDER_DIR/bin/cinder-volume --config-file $CINDER_CONF"
- screen_it c-sch "cd $CINDER_DIR && $CINDER_DIR/bin/cinder-scheduler --config-file $CINDER_CONF"
+ screen_it c-api "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
+ screen_it c-vol "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-volume --config-file $CINDER_CONF"
+ screen_it c-sch "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
}
# stop_cinder() - Stop running processes (non-screen)