Formatting cleanups, doc updates and whatnot
Change-Id: Ica8298353be22f947c8e8a03d8dc29ded9cb26dd
diff --git a/lib/baremetal b/lib/baremetal
index 17a967f..8658c3a 100644
--- a/lib/baremetal
+++ b/lib/baremetal
@@ -53,6 +53,7 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
# Sub-driver settings
# -------------------
diff --git a/lib/ceilometer b/lib/ceilometer
index f7d14d5..6b110cb 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -37,12 +37,16 @@
CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
# Support potential entry-points console scripts
-if [ -d $CEILOMETER_DIR/bin ] ; then
+if [[ -d $CEILOMETER_DIR/bin ]]; then
CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
else
CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
fi
+
+# Functions
+# ---------
+
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_ceilometer() {
@@ -93,7 +97,7 @@
}
function configure_mongodb() {
- if is_fedora ; then
+ if is_fedora; then
# ensure smallfiles selected to minimize freespace requirements
sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod
@@ -135,6 +139,7 @@
done
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/cinder b/lib/cinder
index deace68..d621e69 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -64,6 +64,10 @@
VOLUME_GROUP2=${VOLUME_GROUP2:-stack-volumes2}
VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
+
+# Functions
+# ---------
+
# _clean_volume_group removes all cinder volumes from the specified volume group
# _clean_volume_group $VOLUME_GROUP $VOLUME_NAME_PREFIX
function _clean_volume_group() {
@@ -432,6 +436,7 @@
fi
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/database b/lib/database
index cbe886f..e63d5e2 100644
--- a/lib/database
+++ b/lib/database
@@ -20,14 +20,18 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
# Register a database backend
# $1 The name of the database backend
+# This is required to be defined before the specific database scripts are sourced
function register_database {
[ -z "$DATABASE_BACKENDS" ] && DATABASE_BACKENDS=$1 || DATABASE_BACKENDS+=" $1"
}
# Sourcing the database libs sets DATABASE_BACKENDS with the available list
-for f in $TOP_DIR/lib/databases/*; do source $f; done
+for f in $TOP_DIR/lib/databases/*; do
+ source $f;
+done
# ``DATABASE_BACKENDS`` now contains a list of the supported databases
# Look in ``ENABLED_SERVICES`` to see if one has been selected
@@ -42,6 +46,9 @@
# This is not an error as multi-node installs will do this on the compute nodes
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database {
cleanup_database_$DATABASE_TYPE
@@ -112,6 +119,7 @@
database_connection_url_$DATABASE_TYPE $var $db
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 30450b1..056aec4 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -8,8 +8,13 @@
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
register_database mysql
+
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database_mysql {
if is_ubuntu; then
@@ -137,6 +142,7 @@
echo "$BASE_SQL_CONN/$db?charset=utf8"
}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/databases/postgresql b/lib/databases/postgresql
index b64de2c..b173772 100644
--- a/lib/databases/postgresql
+++ b/lib/databases/postgresql
@@ -8,8 +8,13 @@
PG_XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
register_database postgresql
+
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database_postgresql {
stop_service postgresql
@@ -88,6 +93,7 @@
echo "$BASE_SQL_CONN/$db?client_encoding=utf8"
}
+
# Restore xtrace
$PG_XTRACE
diff --git a/lib/glance b/lib/glance
index 3376400..583f879 100644
--- a/lib/glance
+++ b/lib/glance
@@ -51,8 +51,8 @@
GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
-# Entry Points
-# ------------
+# Functions
+# ---------
# cleanup_glance() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
@@ -199,6 +199,7 @@
screen -S $SCREEN_NAME -p g-reg -X kill
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/heat b/lib/heat
index 88535c3..32c0182 100644
--- a/lib/heat
+++ b/lib/heat
@@ -25,9 +25,14 @@
# Defaults
# --------
+
+# set up default directories
HEAT_DIR=$DEST/heat
HEATCLIENT_DIR=$DEST/python-heatclient
-# set up default directories
+
+
+# Functions
+# ---------
# cleanup_heat() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
@@ -182,6 +187,7 @@
done
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/horizon b/lib/horizon
index b63e1f8..94aac5c 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -38,6 +38,10 @@
APACHE_USER=${APACHE_USER:-$USER}
APACHE_GROUP=${APACHE_GROUP:-$(id -gn $APACHE_USER)}
+
+# Functions
+# ---------
+
# utility method of setting python option
function _horizon_config_set() {
local file=$1
diff --git a/lib/keystone b/lib/keystone
index 0fbc7d7..6bf4d9f 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -63,8 +63,8 @@
SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}
-# Entry Points
-# ------------
+# Functions
+# ---------
# cleanup_keystone() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
diff --git a/lib/ldap b/lib/ldap
index 53f6837..89b31b2 100644
--- a/lib/ldap
+++ b/lib/ldap
@@ -1,13 +1,17 @@
# lib/ldap
# Functions to control the installation and configuration of **ldap**
-# ``stack.sh`` calls the entry points in this order:
-#
+# ``lib/keystone`` calls the entry points in this order:
+# install_ldap()
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
+# Functions
+# ---------
+
# install_ldap
# install_ldap() - Collect source and prepare
function install_ldap() {
@@ -44,7 +48,7 @@
fi
# add our top level ldap nodes
- if ldapsearch -x -w $LDAP_PASSWORD -H ldap://localhost -D dc=Manager,dc=openstack,dc=org -x -b dc=openstack,dc=org | grep -q "Success" ; then
+ if ldapsearch -x -w $LDAP_PASSWORD -H ldap://localhost -D dc=Manager,dc=openstack,dc=org -x -b dc=openstack,dc=org | grep -q "Success"; then
printf "LDAP already configured for OpenStack\n"
if [[ "$KEYSTONE_CLEAR_LDAP" == "yes" ]]; then
# clear LDAP state
diff --git a/lib/nova b/lib/nova
index 8d045b5..ea73bad 100644
--- a/lib/nova
+++ b/lib/nova
@@ -122,8 +122,8 @@
TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
-# Entry Points
-# ------------
+# Functions
+# ---------
function add_nova_opt {
echo "$1" >>$NOVA_CONF
@@ -276,7 +276,7 @@
configure_baremetal_nova_dirs
fi
- if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF ; then
+ if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
# Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
cat <<EOF | sudo tee -a $QEMU_CONF
cgroup_device_acl = [
@@ -509,7 +509,7 @@
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
fi
- if is_service_enabled n-novnc || is_service_enabled n-xvnc ; then
+ if is_service_enabled n-novnc || is_service_enabled n-xvnc; then
# Address on which instance vncservers will listen on compute hosts.
# For multi-host, this should be the management ip of the compute host.
VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
@@ -673,6 +673,7 @@
done
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/quantum b/lib/quantum
index e2a0d53..34d51f8 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -53,7 +53,6 @@
#
# With Quantum networking the NETWORK_MANAGER variable is ignored.
-
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
@@ -172,6 +171,7 @@
OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
fi
+
# Quantum plugin specific functions
# ---------------------------------
# Please refer to lib/quantum_plugins/README.md for details.
@@ -189,8 +189,9 @@
Q_USE_SECGROUP=False
fi
-# Entry Points
-# ------------
+
+# Functions
+# ---------
# configure_quantum()
# Set common config for all quantum server and agents.
@@ -730,7 +731,7 @@
local timeout_sec=$5
local probe_cmd = ""
probe_cmd=`_get_probe_cmd_prefix $from_net`
- if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success ; do sleep 1; done"; then
+ if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success; do sleep 1; done"; then
die $LINENO "server didn't become ssh-able!"
fi
}
diff --git a/lib/rpc_backend b/lib/rpc_backend
index d08cb01..7d165a4 100644
--- a/lib/rpc_backend
+++ b/lib/rpc_backend
@@ -17,8 +17,9 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
-# Entry Points
-# ------------
+
+# Functions
+# ---------
# Make sure we only have one rpc backend enabled.
# Also check the specified rpc backend is available on your platform.
@@ -157,6 +158,7 @@
( ! ([[ "$DISTRO" = "oneiric" ]] || is_suse) )
}
+
# Restore xtrace
$XTRACE
diff --git a/lib/swift b/lib/swift
index ca9c373..36bca4c 100644
--- a/lib/swift
+++ b/lib/swift
@@ -84,8 +84,8 @@
ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
-# Entry Points
-# ------------
+# Functions
+# ---------
# cleanup_swift() - Remove residual data files
function cleanup_swift() {
diff --git a/lib/tempest b/lib/tempest
index c1dc3a3..e59737b 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -50,8 +50,9 @@
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
-# Entry Points
-# ------------
+
+# Functions
+# ---------
# configure_tempest() - Set config files, create data dirs, etc
function configure_tempest() {
diff --git a/lib/tls b/lib/tls
index fb8f4b9..f7dcffa 100644
--- a/lib/tls
+++ b/lib/tls
@@ -21,6 +21,9 @@
# start_tls_proxy HOST_IP 5000 localhost 5000
+# Defaults
+# --------
+
if is_service_enabled tls-proxy; then
# TODO(dtroyer): revisit this below after the search for HOST_IP has been done
TLS_IP=${TLS_IP:-$SERVICE_IP}
@@ -317,6 +320,7 @@
stud $STUD_PROTO -f $f_host,$f_port -b $b_host,$b_port $DEVSTACK_CERT 2>/dev/null
}
+
# Local variables:
# mode: shell-script
# End: