From 567e93a1ffc7f46079115c97592ea3543e68d84f Mon Sep 17 00:00:00 2001 From: rabi Date: Sat, 27 Aug 2016 11:59:29 +0530 Subject: [PATCH] Use heat functions from plugin for upgrade Now that we've the devstack plugin in-tree let's use the functions from the plugin for upgrade, so that we can remove the devstack tree heat code. Change-Id: Ic392bcc24bc374ee8511a94f1d8f6ac23131c7e3 --- devstack/plugin.sh | 7 +++++-- devstack/upgrade/upgrade.sh | 16 ++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 9795effd1c..20f5261dfc 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -11,13 +11,16 @@ source $DEST/heat/devstack/lib/heat if is_heat_enabled; then if [[ "$1" == "stack" && "$2" == "install" ]]; then echo_summary "Installing heat" - install_heat + # Use stack_install_service here to account for vitualenv + stack_install_service heat echo_summary "Installing heatclient" install_heatclient echo_summary "Installing heat other" install_heat_other - cleanup_heat + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + echo_summary "Cleaning up heat" + cleanup_heat echo_summary "Configuring heat" configure_heat diff --git a/devstack/upgrade/upgrade.sh b/devstack/upgrade/upgrade.sh index 454afa406b..5dc7362be2 100755 --- a/devstack/upgrade/upgrade.sh +++ b/devstack/upgrade/upgrade.sh @@ -48,13 +48,19 @@ set -o errexit # Upgrade Heat # ============ +# Locate heat devstack plugin, the directory above the +# grenade plugin. +HEAT_DEVSTACK_DIR=$(dirname $(dirname $0)) + # Duplicate some setup bits from target DevStack source $TARGET_DEVSTACK_DIR/functions source $TARGET_DEVSTACK_DIR/stackrc source $TARGET_DEVSTACK_DIR/lib/tls source $TARGET_DEVSTACK_DIR/lib/stack source $TARGET_DEVSTACK_DIR/lib/apache -source $TARGET_DEVSTACK_DIR/lib/heat + +# Get heat functions from devstack plugin +source $HEAT_DEVSTACK_DIR/lib/heat # Print the commands being run so that we can see the command that triggers # an error. It is also useful for following allowing as the install occurs. @@ -63,10 +69,8 @@ set -o xtrace # Save current config files for posterity [[ -d $SAVE_DIR/etc.heat ]] || cp -pr $HEAT_CONF_DIR $SAVE_DIR/etc.heat -# install_heat() -stack_install_service heat -install_heatclient -install_heat_other +# Install the target heat +source $HEAT_DEVSTACK_DIR/plugin.sh stack install # calls upgrade-heat for specific release upgrade_project heat $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH @@ -78,7 +82,7 @@ HEAT_BIN_DIR=$(dirname $(which heat-manage)) $HEAT_BIN_DIR/heat-manage --config-file $HEAT_CONF db_sync || die $LINENO "DB sync error" # Start Heat -start_heat +start_heat_with_plugin # Don't succeed unless the services come up ensure_services_started heat-api heat-engine heat-api-cloudwatch heat-api-cfn