Skip to content

Commit fc744f9

Browse files
author
Dean Troyer
committed
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
1 parent b53dbad commit fc744f9

4 files changed

Lines changed: 44 additions & 29 deletions

File tree

extras.d/70-trove

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# trove.sh - Devstack extras script to install Trove
2+
3+
if is_service_enabled trove; then
4+
if [[ "$1" == "source" ]]; then
5+
# Initial source
6+
source $TOP_DIR/lib/trove
7+
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
8+
echo_summary "Installing Trove"
9+
install_trove
10+
install_troveclient
11+
cleanup_trove
12+
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
13+
echo_summary "Configuring Trove"
14+
configure_troveclient
15+
configure_trove
16+
17+
if is_service_enabled key; then
18+
create_trove_accounts
19+
fi
20+
21+
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
22+
# Initialize trove
23+
init_trove
24+
25+
# Start the trove API and trove taskmgr components
26+
echo_summary "Starting Trove"
27+
start_trove
28+
fi
29+
30+
if [[ "$1" == "unstack" ]]; then
31+
stop_trove
32+
fi
33+
fi

lib/trove

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ else
3838
TROVE_BIN_DIR=$(get_python_exec_prefix)
3939
fi
4040

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+
4151
# setup_trove_logging() - Adds logging configuration to conf files
4252
function setup_trove_logging() {
4353
local CONF=$1

stack.sh

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ``stack.sh`` is an opinionated OpenStack developer installation. It
44
# installs and configures various combinations of **Ceilometer**, **Cinder**,
55
# **Glance**, **Heat**, **Horizon**, **Keystone**, **Nova**, **Neutron**,
6-
# **Swift**, and **Trove**
6+
# and **Swift**
77

88
# This script allows you to specify configuration options of what git
99
# repositories to use, enabled services, network configuration and various
@@ -337,7 +337,6 @@ source $TOP_DIR/lib/neutron
337337
source $TOP_DIR/lib/baremetal
338338
source $TOP_DIR/lib/ldap
339339
source $TOP_DIR/lib/ironic
340-
source $TOP_DIR/lib/trove
341340

342341
# Extras Source
343342
# --------------
@@ -739,12 +738,6 @@ if is_service_enabled heat; then
739738
configure_heat
740739
fi
741740

742-
if is_service_enabled trove; then
743-
install_trove
744-
install_troveclient
745-
cleanup_trove
746-
fi
747-
748741
if is_service_enabled tls-proxy; then
749742
configure_CA
750743
init_CA
@@ -927,10 +920,6 @@ if is_service_enabled key; then
927920
create_cinder_accounts
928921
create_neutron_accounts
929922

930-
if is_service_enabled trove; then
931-
create_trove_accounts
932-
fi
933-
934923
if is_service_enabled ceilometer; then
935924
create_ceilometer_accounts
936925
fi
@@ -1204,19 +1193,6 @@ if is_service_enabled heat; then
12041193
start_heat
12051194
fi
12061195

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-
12201196

12211197
# Create account rc files
12221198
# =======================

unstack.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ source $TOP_DIR/lib/neutron
5656
source $TOP_DIR/lib/baremetal
5757
source $TOP_DIR/lib/ldap
5858
source $TOP_DIR/lib/ironic
59-
source $TOP_DIR/lib/trove
6059

6160
# Extras Source
6261
# --------------
@@ -92,9 +91,6 @@ if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
9291
fi
9392

9493
# Call service stop
95-
if is_service_enabled trove; then
96-
stop_trove
97-
fi
9894

9995
if is_service_enabled heat; then
10096
stop_heat

0 commit comments

Comments
 (0)