1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/usr/bin/env bash
# plugin.sh - DevStack plugin.sh dispatch script vitrage-dashboard
function install_vitrage_dashboard {
setup_develop ${VITRAGE_DASHBOARD_DIR}
}
function configure_vitrage_dashboard {
cp -a ${VITRAGE_DASHBOARD_DIR}/vitrage_dashboard/enabled/* ${HORIZON_DIR}/openstack_dashboard/local/enabled/
}
function init_vitrage_dashboard {
$PYTHON ${DEST}/horizon/manage.py collectstatic --noinput
$PYTHON ${DEST}/horizon//manage.py compress --force
}
# check for service enabled
if is_service_enabled vitrage-dashboard; 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 Vitrage Dashboard"
install_vitrage_dashboard
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Configure after the other layer 1 and 2 services have been configured
echo_summary "Configuring Vitrage Dashboard"
configure_vitrage_dashboard
init_vitrage_dashboard
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Initialize and start the vitrage-dashboard service
# no-op
:
fi
if [[ "$1" == "unstack" ]]; then
# Shut down vitrage-dashboard services
# no-op
:
fi
if [[ "$1" == "clean" ]]; then
rm -f ${HORIZON_DIR}/openstack_dashboard/local/enabled/_40*
rm -f ${HORIZON_DIR}/openstack_dashboard/local/enabled/_41*
# for backward computability
rm -f ${HORIZON_DIR}/openstack_dashboard/enabled/_40*
rm -f ${HORIZON_DIR}/openstack_dashboard/enabled/_41*
fi
fi
|