From 457249be7ab3849b3479b96077a411ca37c37a95 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Wed, 19 Oct 2016 15:28:58 -0300 Subject: [PATCH] Adds Manila-UI Devstack plugin Manila-UI was being deployed if Manila plugin was enabled. This is not the most advisable thing since counting on an UI is not neccesary for the majority of the cases when contributing code to Manila. This patch-set adds the posibility of deploying the UI on demand by enabling it as a plugin for Devstack as follows: enable_plugin manila-ui https://github.com/openstack/manila-ui Change-Id: Id564e4ea6b675aa197ae377aa7a756e1bd0625b6 Closes-Bug: #1570033 Implements BP add-devstack-plugin --- devstack/plugin.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ devstack/settings | 5 +++++ 2 files changed, 51 insertions(+) create mode 100644 devstack/plugin.sh create mode 100644 devstack/settings diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 00000000..6a55bfb8 --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,46 @@ +# plugin.sh - DevStack plugin.sh dispatch script manila-ui + +function install_manila_ui { + # NOTE(vponomaryov): workaround for devstack bug: 1540328 + # where devstack install 'test-requirements' but should not do it + # for manila-ui project as it installs Horizon from url. + # Remove following two 'mv' commands when mentioned bug is fixed. + mv $MANILA_UI_DIR/test-requirements.txt $MANILA_UI_DIR/_test-requirements.txt + + setup_develop ${MANILA_UI_DIR} + + mv $MANILA_UI_DIR/_test-requirements.txt $MANILA_UI_DIR/test-requirements.txt +} + +# check for service enabled +if is_service_enabled horizon && is_service_enabled manila && is_service_enabled manila-ui; then + + if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then + # Set up system services + # no-op + : + elif [[ "$1" == "stack" && "$2" == "install" ]]; then + # Perform installation of service source + echo_summary "Installing Manila UI" + install_manila_ui + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # Configure after the other layer 1 and 2 services have been configured + echo_summary "Configuring Manila UI" + cp -a ${MANILA_UI_DIR}/manila_ui/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + # no-op + : + fi + + if [[ "$1" == "unstack" ]]; then + # no-op + : + fi + + if [[ "$1" == "clean" ]]; then + # Remove state and transient data + # Remember clean.sh first calls unstack.sh + # no-op + : + fi +fi diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 00000000..988a6584 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,5 @@ +# settings file for manila-ui plugin +enable_service manila-ui + +# set up default directories +MANILA_UI_DIR=${MANILA_UI_DIR:=$DEST/manila-ui}