Browse code

Convert trove to plugin

Also adds an is_trove_enabled() function to match
https://review.openstack.org/69497 changes for is_service_enabled().

Change-Id: Ic0408ff6d9816aec8a3506931470470342a5dcd7

Dean Troyer authored on 2014/01/28 04:45:21
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+# trove.sh - Devstack extras script to install Trove
1
+
2
+if is_service_enabled trove; then
3
+    if [[ "$1" == "source" ]]; then
4
+        # Initial source
5
+        source $TOP_DIR/lib/trove
6
+    elif [[ "$1" == "stack" && "$2" == "install" ]]; then
7
+        echo_summary "Installing Trove"
8
+        install_trove
9
+        install_troveclient
10
+        cleanup_trove
11
+    elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
12
+        echo_summary "Configuring Trove"
13
+        configure_troveclient
14
+        configure_trove
15
+
16
+        if is_service_enabled key; then
17
+            create_trove_accounts
18
+        fi
19
+
20
+    elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
21
+        # Initialize trove
22
+        init_trove
23
+
24
+        # Start the trove API and trove taskmgr components
25
+        echo_summary "Starting Trove"
26
+        start_trove
27
+    fi
28
+
29
+    if [[ "$1" == "unstack" ]]; then
30
+        stop_trove
31
+    fi
32
+fi
... ...
@@ -38,6 +38,16 @@ else
38 38
     TROVE_BIN_DIR=$(get_python_exec_prefix)
39 39
 fi
40 40
 
41
+# Functions
42
+# ---------
43
+
44
+# Test if any Trove services are enabled
45
+# is_trove_enabled
46
+function is_trove_enabled {
47
+    [[ ,${ENABLED_SERVICES} =~ ,"tr-" ]] && return 0
48
+    return 1
49
+}
50
+
41 51
 # setup_trove_logging() - Adds logging configuration to conf files
42 52
 function setup_trove_logging() {
43 53
     local CONF=$1
... ...
@@ -3,7 +3,7 @@
3 3
 # ``stack.sh`` is an opinionated OpenStack developer installation.  It
4 4
 # installs and configures various combinations of **Ceilometer**, **Cinder**,
5 5
 # **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Neutron**,
6
-# **Swift**, and **Trove**
6
+# and **Swift**
7 7
 
8 8
 # This script allows you to specify configuration options of what git
9 9
 # repositories to use, enabled services, network configuration and various
... ...
@@ -337,7 +337,6 @@ source $TOP_DIR/lib/neutron
337 337
 source $TOP_DIR/lib/baremetal
338 338
 source $TOP_DIR/lib/ldap
339 339
 source $TOP_DIR/lib/ironic
340
-source $TOP_DIR/lib/trove
341 340
 
342 341
 # Extras Source
343 342
 # --------------
... ...
@@ -739,12 +738,6 @@ if is_service_enabled heat; then
739 739
     configure_heat
740 740
 fi
741 741
 
742
-if is_service_enabled trove; then
743
-    install_trove
744
-    install_troveclient
745
-    cleanup_trove
746
-fi
747
-
748 742
 if is_service_enabled tls-proxy; then
749 743
     configure_CA
750 744
     init_CA
... ...
@@ -927,10 +920,6 @@ if is_service_enabled key; then
927 927
     create_cinder_accounts
928 928
     create_neutron_accounts
929 929
 
930
-    if is_service_enabled trove; then
931
-        create_trove_accounts
932
-    fi
933
-
934 930
     if is_service_enabled ceilometer; then
935 931
         create_ceilometer_accounts
936 932
     fi
... ...
@@ -1204,19 +1193,6 @@ if is_service_enabled heat; then
1204 1204
     start_heat
1205 1205
 fi
1206 1206
 
1207
-# Configure and launch the trove service api, and taskmanager
1208
-if is_service_enabled trove; then
1209
-    # Initialize trove
1210
-    echo_summary "Configuring Trove"
1211
-    configure_troveclient
1212
-    configure_trove
1213
-    init_trove
1214
-
1215
-    # Start the trove API and trove taskmgr components
1216
-    echo_summary "Starting Trove"
1217
-    start_trove
1218
-fi
1219
-
1220 1207
 
1221 1208
 # Create account rc files
1222 1209
 # =======================
... ...
@@ -56,7 +56,6 @@ source $TOP_DIR/lib/neutron
56 56
 source $TOP_DIR/lib/baremetal
57 57
 source $TOP_DIR/lib/ldap
58 58
 source $TOP_DIR/lib/ironic
59
-source $TOP_DIR/lib/trove
60 59
 
61 60
 # Extras Source
62 61
 # --------------
... ...
@@ -92,9 +91,6 @@ if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
92 92
 fi
93 93
 
94 94
 # Call service stop
95
-if is_service_enabled trove; then
96
-    stop_trove
97
-fi
98 95
 
99 96
 if is_service_enabled heat; then
100 97
     stop_heat