File: plugin.sh

package info (click to toggle)
watcher-dashboard 14.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 900 kB
  • sloc: python: 3,035; sh: 568; javascript: 50; makefile: 34
file content (56 lines) | stat: -rw-r--r-- 1,803 bytes parent folder | download | duplicates (2)
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
# plugin.sh - DevStack plugin.sh dispatch script watcher-dashboard

WATCHER_DASHBOARD_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd)

function install_watcher_dashboard {
    setup_develop ${WATCHER_DASHBOARD_DIR}
}

function configure_watcher_dashboard {
    cp -a ${WATCHER_DASHBOARD_DIR}/watcher_dashboard/local/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/
    cp -a ${WATCHER_DASHBOARD_DIR}/watcher_dashboard/conf/* ${DEST}/horizon/openstack_dashboard/conf/
}

function init_watcher_dashboard {
    # Setup alias for django-admin which could be different depending on distro
    $PYTHON ${DEST}/horizon/manage.py collectstatic --noinput
    $PYTHON ${DEST}/horizon/manage.py compress --force
}

# check for service enabled
if is_service_enabled watcher-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 Watcher Dashboard"
        install_watcher_dashboard

    elif [[ "$1" == "stack" && "$2" == "post-config"  ]]; then
        # Configure after the other layer 1 and 2 services have been configured
        echo_summary "Configurng Watcher Dashboard"
        configure_watcher_dashboard
        init_watcher_dashboard

    elif [[ "$1" == "stack" && "$2" == "extra"  ]]; then
        # no-op
        :
    fi

    if [[ "$1" == "unstack"  ]]; then
        rm -f ${DEST}/horizon/openstack_dashboard/local/enabled/_310*
        rm -f ${DEST}/horizon/openstack_dashboard/conf/watcher*

    fi

    if [[ "$1" == "clean"  ]]; then
        # Remove state and transient data
        # Remember clean.sh first calls unstack.sh
        # no-op
        :
    fi
fi