From 3f470657e7e316984a3e56372de43f17e0a9a6af Mon Sep 17 00:00:00 2001
From: Lianhao Lu <lianhao.lu@intel.com>
Date: Wed, 23 Mar 2016 15:54:10 +0800
Subject: [PATCH] devstack: support to be enabled with different plugin name

Allow rally to be installed by devstack through a different plugin
name, e.g:

    enable_plugin test-rally http://github.com/rally/rally.git master

Change-Id: I43be7f7beba83ac63f6e16bdac216a41f4e2f057
Closes-Bug: #1560833
---
 devstack/lib/rally | 3 ++-
 devstack/plugin.sh | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/devstack/lib/rally b/devstack/lib/rally
index c0cde6ee82..62f8693c83 100644
--- a/devstack/lib/rally
+++ b/devstack/lib/rally
@@ -21,7 +21,8 @@ set +o xtrace
 # --------
 
 # Set up default directories
-RALLY_DIR=$DEST/rally
+DIR=$(dirname ${BASH_SOURCE[0]})
+RALLY_DIR=$(readlink -m $DIR/../..)
 RALLY_CONF_DIR=${RALLY_CONF_DIR:-/etc/rally}
 RALLY_CONF_FILE=rally.conf
 
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index a5199f73d3..25bf755e79 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -4,7 +4,8 @@
 XTRACE=$(set +o | grep xtrace)
 set -o xtrace
 
-source $DEST/rally/devstack/lib/rally
+DIR=$(dirname ${BASH_SOURCE[0]})
+source $DIR/lib/rally
 
 if [[ "$1" == "stack" && "$2" == "install" ]]; then
     echo_summary "Installing Rally"