From bd4d8ad315675fc02d48401a1f74d38a6888ec42 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 16 Mar 2016 21:06:05 +0900 Subject: [PATCH] Add DevStack plugin Change-Id: I441cf8c7b308655dbfa0bc1de187ba20096bf999 --- devstack/plugin.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++ devstack/settings | 2 ++ 2 files changed, 54 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..bb0096ce --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,52 @@ +# plugin.sh - DevStack plugin.sh dispatch script magnum-ui + +MAGNUM_UI_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd) + +function install_magnum_ui { + setup_develop ${MAGNUM_UI_DIR} +} + +function configure_magnum_ui { + cp -a ${MAGNUM_UI_DIR}/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ + # NOTE: If locale directory does not exist, compilemessages will fail, + # so check for an existence of locale directory is required. + if [ -d ${MAGNUM_UI_DIR}/magnum_ui/locale ]; then + (cd ${MAGNUM_UI_DIR}/magnum_ui; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages) + fi +} + +# check for service enabled +if is_service_enabled magnum-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 Magnum UI" + install_magnum_ui + + elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + # Configure after the other layer 1 and 2 services have been configured + echo_summary "Configurng Magnum UI" + configure_magnum_ui + + 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..04c413d3 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,2 @@ +# settings file for magnum-ui plugin +enable_service magnum-ui