Browse code

Move sahara client installation to lib/sahara

All other projects installs their clients in the same lib file as the
main services.

Remove sahara-dashboard installation

Sahara dashboard is now merged into the Horizon and enabled by default
(when data_processing endpoint is available), so, we should stop
installing it as separated dashboard.

Change-Id: I1f0e93e1dee3d065c4f00d8bf2042bebc8d45a22

Sergey Lukjanov authored on 2014/08/05 21:14:12
Showing 3 changed files
... ...
@@ -8,17 +8,12 @@ if is_service_enabled sahara; then
8 8
     elif [[ "$1" == "stack" && "$2" == "install" ]]; then
9 9
         echo_summary "Installing sahara"
10 10
         install_sahara
11
+        install_python_saharaclient
11 12
         cleanup_sahara
12
-        if is_service_enabled horizon; then
13
-            install_sahara_dashboard
14
-        fi
15 13
     elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
16 14
         echo_summary "Configuring sahara"
17 15
         configure_sahara
18 16
         create_sahara_accounts
19
-        if is_service_enabled horizon; then
20
-            configure_sahara_dashboard
21
-        fi
22 17
     elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
23 18
         echo_summary "Initializing sahara"
24 19
         start_sahara
... ...
@@ -26,9 +21,6 @@ if is_service_enabled sahara; then
26 26
 
27 27
     if [[ "$1" == "unstack" ]]; then
28 28
         stop_sahara
29
-        if is_service_enabled horizon; then
30
-            cleanup_sahara_dashboard
31
-        fi
32 29
     fi
33 30
 
34 31
     if [[ "$1" == "clean" ]]; then
... ...
@@ -7,6 +7,7 @@
7 7
 # ``stack.sh`` calls the entry points in this order:
8 8
 #
9 9
 # install_sahara
10
+# install_python_saharaclient
10 11
 # configure_sahara
11 12
 # start_sahara
12 13
 # stop_sahara
... ...
@@ -24,8 +25,13 @@ set +o xtrace
24 24
 SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git}
25 25
 SAHARA_BRANCH=${SAHARA_BRANCH:-master}
26 26
 
27
+SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
28
+SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master}
29
+
27 30
 # Set up default directories
28 31
 SAHARA_DIR=$DEST/sahara
32
+SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient
33
+
29 34
 SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara}
30 35
 SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf
31 36
 
... ...
@@ -154,6 +160,12 @@ function install_sahara {
154 154
     setup_develop $SAHARA_DIR
155 155
 }
156 156
 
157
+# install_python_saharaclient() - Collect source and prepare
158
+function install_python_saharaclient {
159
+    git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH
160
+    setup_develop $SAHARA_PYTHONCLIENT_DIR
161
+}
162
+
157 163
 # start_sahara() - Start running processes, including screen
158 164
 function start_sahara {
159 165
     screen_it sahara "cd $SAHARA_DIR && $SAHARA_BIN_DIR/sahara-all --config-file $SAHARA_CONF_FILE"
160 166
deleted file mode 100644
... ...
@@ -1,72 +0,0 @@
1
-# lib/sahara-dashboard
2
-
3
-# Dependencies:
4
-#
5
-# - ``functions`` file
6
-# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
7
-# - ``SERVICE_HOST``
8
-
9
-# ``stack.sh`` calls the entry points in this order:
10
-#
11
-# - install_sahara_dashboard
12
-# - configure_sahara_dashboard
13
-# - cleanup_sahara_dashboard
14
-
15
-# Save trace setting
16
-XTRACE=$(set +o | grep xtrace)
17
-set +o xtrace
18
-
19
-source $TOP_DIR/lib/horizon
20
-
21
-# Defaults
22
-# --------
23
-
24
-# Set up default repos
25
-SAHARA_DASHBOARD_REPO=${SAHARA_DASHBOARD_REPO:-${GIT_BASE}/openstack/sahara-dashboard.git}
26
-SAHARA_DASHBOARD_BRANCH=${SAHARA_DASHBOARD_BRANCH:-master}
27
-
28
-SAHARA_PYTHONCLIENT_REPO=${SAHARA_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
29
-SAHARA_PYTHONCLIENT_BRANCH=${SAHARA_PYTHONCLIENT_BRANCH:-master}
30
-
31
-# Set up default directories
32
-SAHARA_DASHBOARD_DIR=$DEST/sahara-dashboard
33
-SAHARA_PYTHONCLIENT_DIR=$DEST/python-saharaclient
34
-
35
-# Functions
36
-# ---------
37
-
38
-function configure_sahara_dashboard {
39
-
40
-    echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
41
-    echo -e "HORIZON_CONFIG['dashboards'] += ('sahara',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
42
-    echo -e "INSTALLED_APPS += ('saharadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
43
-
44
-    if is_service_enabled neutron; then
45
-        echo -e "SAHARA_USE_NEUTRON = True" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
46
-    fi
47
-}
48
-
49
-# install_sahara_dashboard() - Collect source and prepare
50
-function install_sahara_dashboard {
51
-    install_python_saharaclient
52
-    git_clone $SAHARA_DASHBOARD_REPO $SAHARA_DASHBOARD_DIR $SAHARA_DASHBOARD_BRANCH
53
-    setup_develop $SAHARA_DASHBOARD_DIR
54
-}
55
-
56
-function install_python_saharaclient {
57
-    git_clone $SAHARA_PYTHONCLIENT_REPO $SAHARA_PYTHONCLIENT_DIR $SAHARA_PYTHONCLIENT_BRANCH
58
-    setup_develop $SAHARA_PYTHONCLIENT_DIR
59
-}
60
-
61
-# Cleanup file settings.py from Sahara
62
-function cleanup_sahara_dashboard {
63
-    sed -i '/sahara/d' $HORIZON_DIR/openstack_dashboard/settings.py
64
-}
65
-
66
-# Restore xtrace
67
-$XTRACE
68
-
69
-# Local variables:
70
-# mode: shell-script
71
-# End:
72
-