Holiday docs and comment formatting cleanup

Change-Id: Ia4ca88c67d3b94e306a79a669805a2fa1b0dc069
This commit is contained in:
Dean Troyer 2012-12-21 11:03:37 -06:00
parent 5ba0360b32
commit 6d04fd7ba5
12 changed files with 81 additions and 101 deletions

View File

@ -15,6 +15,16 @@ https://github.com/openstack-dev/devstack.git. Besides the master branch that
tracks the OpenStack trunk branches a separate branch is maintained for all tracks the OpenStack trunk branches a separate branch is maintained for all
OpenStack releases starting with Diablo (stable/diablo). OpenStack releases starting with Diablo (stable/diablo).
Contributing code to DevStack follows the usual OpenStack process as described
in `How To Contribute`__ in the OpenStack wiki. `DevStack's LaunchPad project`__
contains the usual links for blueprints, bugs, tec.
__ contribute_
.. _contribute: http://wiki.openstack.org/HowToContribute.
__ lp_
.. _lp: https://launchpad.net/~devstack
The primary script in DevStack is ``stack.sh``, which performs the bulk of the The primary script in DevStack is ``stack.sh``, which performs the bulk of the
work for DevStack's use cases. There is a subscript ``functions`` that contains work for DevStack's use cases. There is a subscript ``functions`` that contains
generally useful shell functions and is used by a number of the scripts in generally useful shell functions and is used by a number of the scripts in
@ -53,8 +63,8 @@ configuration of the user environment::
source $TOP_DIR/openrc source $TOP_DIR/openrc
``stack.sh`` is a rather large monolithic script that flows through from beginning ``stack.sh`` is a rather large monolithic script that flows through from beginning
to end. The process of breaking it down into project-level sub-scripts has begun to end. The process of breaking it down into project-level sub-scripts is nearly
with the introduction of ``lib/cinder`` and ``lib/ceilometer``. complete and should make ``stack.sh`` easier to read and manage.
These library sub-scripts have a number of fixed entry points, some of which may These library sub-scripts have a number of fixed entry points, some of which may
just be stubs. These entry points will be called by ``stack.sh`` in the just be stubs. These entry points will be called by ``stack.sh`` in the
@ -71,6 +81,12 @@ There is a sub-script template in ``lib/templates`` to be used in creating new
service sub-scripts. The comments in ``<>`` are meta comments describing service sub-scripts. The comments in ``<>`` are meta comments describing
how to use the template and should be removed. how to use the template and should be removed.
In order to show the dependencies and conditions under which project functions
are executed the top-level conditional testing for things like ``is_service_enabled``
should be done in ``stack.sh``. There may be nested conditionals that need
to be in the sub-script, such as testing for keystone being enabled in
``configure_swift()``.
Documentation Documentation
------------- -------------

View File

@ -1,10 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# **quantum.sh** # **quantum-adv-test.sh**
# We will use this test to perform integration testing of nova and # Perform integration testing of Nova and other components with Quantum.
# other components with Quantum.
echo "*********************************************************************" echo "*********************************************************************"
echo "Begin DevStack Exercise: $0" echo "Begin DevStack Exercise: $0"
@ -14,6 +13,7 @@ echo "*********************************************************************"
# only the first error that occured. # only the first error that occured.
set -o errtrace set -o errtrace
trap failed ERR trap failed ERR
failed() { failed() {
local r=$? local r=$?
@ -30,17 +30,8 @@ failed() {
# an error. It is also useful for following allowing as the install occurs. # an error. It is also useful for following allowing as the install occurs.
set -o xtrace set -o xtrace
#------------------------------------------------------------------------------
# Quantum config check
#------------------------------------------------------------------------------
# Warn if quantum is not enabled
if [[ ! "$ENABLED_SERVICES" =~ "q-svc" ]]; then
echo "WARNING: Running quantum test without enabling quantum"
fi
#------------------------------------------------------------------------------
# Environment # Environment
#------------------------------------------------------------------------------ # -----------
# Keep track of the current directory # Keep track of the current directory
EXERCISE_DIR=$(cd $(dirname "$0") && pwd) EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
@ -62,9 +53,8 @@ source $TOP_DIR/lib/quantum
# Import exercise configuration # Import exercise configuration
source $TOP_DIR/exerciserc source $TOP_DIR/exerciserc
#------------------------------------------------------------------------------ # Quantum Settings
# Test settings for quantum # ----------------
#------------------------------------------------------------------------------
TENANTS="DEMO1" TENANTS="DEMO1"
# TODO (nati)_Test public network # TODO (nati)_Test public network
@ -106,24 +96,17 @@ PUBLIC_ROUTER1_NET="admin-net1"
DEMO1_ROUTER1_NET="demo1-net1" DEMO1_ROUTER1_NET="demo1-net1"
DEMO2_ROUTER1_NET="demo2-net1" DEMO2_ROUTER1_NET="demo2-net1"
#------------------------------------------------------------------------------
# Keystone settings.
#------------------------------------------------------------------------------
KEYSTONE="keystone" KEYSTONE="keystone"
#------------------------------------------------------------------------------ # Manually create a token by querying keystone (sending JSON data). Keystone
# Get a token for clients that don't support service catalog
#------------------------------------------------------------------------------
# manually create a token by querying keystone (sending JSON data). Keystone
# returns a token and catalog of endpoints. We use python to parse the token # returns a token and catalog of endpoints. We use python to parse the token
# and save it. # and save it.
TOKEN=`keystone token-get | grep ' id ' | awk '{print $4}'` TOKEN=`keystone token-get | grep ' id ' | awk '{print $4}'`
#------------------------------------------------------------------------------ # Various functions
# Various functions. # -----------------
#------------------------------------------------------------------------------
function foreach_tenant { function foreach_tenant {
COMMAND=$1 COMMAND=$1
for TENANT in ${TENANTS//,/ };do for TENANT in ${TENANTS//,/ };do
@ -194,8 +177,7 @@ function confirm_server_active {
if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
echo "server '$VM_UUID' did not become active!" echo "server '$VM_UUID' did not become active!"
false false
fi fi
} }
function add_tenant { function add_tenant {
@ -214,23 +196,15 @@ function add_tenant {
function remove_tenant { function remove_tenant {
local TENANT=$1 local TENANT=$1
local TENANT_ID=$(get_tenant_id $TENANT) local TENANT_ID=$(get_tenant_id $TENANT)
$KEYSTONE tenant-delete $TENANT_ID $KEYSTONE tenant-delete $TENANT_ID
} }
function remove_user { function remove_user {
local USER=$1 local USER=$1
local USER_ID=$(get_user_id $USER) local USER_ID=$(get_user_id $USER)
$KEYSTONE user-delete $USER_ID $KEYSTONE user-delete $USER_ID
} }
#------------------------------------------------------------------------------
# "Create" functions
#------------------------------------------------------------------------------
function create_tenants { function create_tenants {
source $TOP_DIR/openrc admin admin source $TOP_DIR/openrc admin admin
add_tenant demo1 demo1 demo1 add_tenant demo1 demo1 demo1
@ -383,9 +357,9 @@ function all {
delete_all delete_all
} }
#------------------------------------------------------------------------------ # Test functions
# Test functions. # --------------
#------------------------------------------------------------------------------
function test_functions { function test_functions {
IMAGE=$(get_image_id) IMAGE=$(get_image_id)
echo $IMAGE echo $IMAGE
@ -400,9 +374,9 @@ function test_functions {
echo $NETWORK_ID echo $NETWORK_ID
} }
#------------------------------------------------------------------------------ # Usage and main
# Usage and main. # --------------
#------------------------------------------------------------------------------
usage() { usage() {
echo "$0: [-h]" echo "$0: [-h]"
echo " -h, --help Display help message" echo " -h, --help Display help message"
@ -473,10 +447,9 @@ main() {
fi fi
} }
# Kick off script
# ---------------
#-------------------------------------------------------------------------------
# Kick off script.
#-------------------------------------------------------------------------------
echo $* echo $*
main $* main $*

View File

@ -1,9 +1,9 @@
# lib/ceilometer # lib/ceilometer
# Install and start Ceilometer service # Install and start **Ceilometer** service
# To enable, add the following to localrc # To enable, add the following to localrc
# ENABLED_SERVICES+=ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api # ENABLED_SERVICES+=ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
# Dependencies: # Dependencies:
# - functions # - functions
# - OS_AUTH_URL for auth in api # - OS_AUTH_URL for auth in api
@ -12,12 +12,12 @@
# stack.sh # stack.sh
# --------- # ---------
# install_XXX # install_ceilometer
# configure_XXX # configure_ceilometer
# init_XXX # init_ceilometer
# start_XXX # start_ceilometer
# stop_XXX # stop_ceilometer
# cleanup_XXX # cleanup_ceilometer
# Save trace setting # Save trace setting
XTRACE=$(set +o | grep xtrace) XTRACE=$(set +o | grep xtrace)
@ -27,17 +27,18 @@ set +o xtrace
# Defaults # Defaults
# -------- # --------
# set up default directories # Set up default directories
CEILOMETER_DIR=$DEST/ceilometer CEILOMETER_DIR=$DEST/ceilometer
CEILOMETER_CONF_DIR=/etc/ceilometer
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
# Support potential entry-points console scripts # Support potential entry-points console scripts
if [ -d $CEILOMETER_DIR/bin ] ; then if [ -d $CEILOMETER_DIR/bin ] ; then
CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
else else
CEILOMETER_BIN_DIR=/usr/local/bin CEILOMETER_BIN_DIR=/usr/local/bin
fi fi
CEILOMETER_CONF_DIR=/etc/ceilometer
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
# cleanup_ceilometer() - Remove residual data files, anything left over from previous # cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up # runs that a clean run would need to clean up

View File

@ -1,5 +1,5 @@
# lib/cinder # lib/cinder
# Install and start Cinder volume service # Install and start **Cinder** volume service
# Dependencies: # Dependencies:
# - functions # - functions

View File

@ -1,5 +1,5 @@
# lib/mysql # lib/databases/mysql
# Functions to control the configuration and operation of the MySQL database backend # Functions to control the configuration and operation of the **MySQL** database backend
# Dependencies: # Dependencies:
# DATABASE_{HOST,USER,PASSWORD} must be defined # DATABASE_{HOST,USER,PASSWORD} must be defined

View File

@ -1,5 +1,5 @@
# lib/postgresql # lib/databases/postgresql
# Functions to control the configuration and operation of the PostgreSQL database backend # Functions to control the configuration and operation of the **PostgreSQL** database backend
# Dependencies: # Dependencies:
# DATABASE_{HOST,USER,PASSWORD} must be defined # DATABASE_{HOST,USER,PASSWORD} must be defined

View File

@ -1,5 +1,5 @@
# lib/glance # lib/glance
# Functions to control the configuration and operation of the Glance service # Functions to control the configuration and operation of the **Glance** service
# Dependencies: # Dependencies:
# ``functions`` file # ``functions`` file
@ -25,8 +25,6 @@ set +o xtrace
# Defaults # Defaults
# -------- # --------
# <define global variables here that belong to this project>
# Set up default directories # Set up default directories
GLANCE_DIR=$DEST/glance GLANCE_DIR=$DEST/glance
GLANCECLIENT_DIR=$DEST/python-glanceclient GLANCECLIENT_DIR=$DEST/python-glanceclient
@ -141,7 +139,6 @@ function configure_glance() {
iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD
cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
} }
# init_glance() - Initialize databases, etc. # init_glance() - Initialize databases, etc.

View File

@ -1,5 +1,6 @@
# lib/heat # lib/heat
# Install and start Heat service # Install and start **Heat** service
# To enable, add the following to localrc # To enable, add the following to localrc
# ENABLED_SERVICES+=,heat,h-api-cfn,h-api-cw,h-eng # ENABLED_SERVICES+=,heat,h-api-cfn,h-api-cw,h-eng
@ -8,12 +9,14 @@
# stack.sh # stack.sh
# --------- # ---------
# install_XXX # install_heatclient
# configure_XXX # install_heat
# init_XXX # configure_heatclient
# start_XXX # configure_heat
# stop_XXX # init_heat
# cleanup_XXX # start_heat
# stop_heat
# cleanup_heat
# Save trace setting # Save trace setting
XTRACE=$(set +o | grep xtrace) XTRACE=$(set +o | grep xtrace)
@ -57,7 +60,7 @@ function configure_heat() {
HEAT_API_HOST=${HEAT_API_HOST:-$SERVICE_HOST} HEAT_API_HOST=${HEAT_API_HOST:-$SERVICE_HOST}
HEAT_API_PORT=${HEAT_API_PORT:-8004} HEAT_API_PORT=${HEAT_API_PORT:-8004}
# cloudformation api # Cloudformation API
HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf
cp $HEAT_DIR/etc/heat/heat-api-cfn.conf $HEAT_API_CFN_CONF cp $HEAT_DIR/etc/heat/heat-api-cfn.conf $HEAT_API_CFN_CONF
iniset $HEAT_API_CFN_CONF DEFAULT debug True iniset $HEAT_API_CFN_CONF DEFAULT debug True
@ -86,7 +89,7 @@ function configure_heat() {
iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0 iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
# openstack api # OpenStack API
HEAT_API_CONF=$HEAT_CONF_DIR/heat-api.conf HEAT_API_CONF=$HEAT_CONF_DIR/heat-api.conf
cp $HEAT_DIR/etc/heat/heat-api.conf $HEAT_API_CONF cp $HEAT_DIR/etc/heat/heat-api.conf $HEAT_API_CONF
iniset $HEAT_API_CONF DEFAULT debug True iniset $HEAT_API_CONF DEFAULT debug True
@ -139,7 +142,7 @@ function configure_heat() {
iniset $HEAT_ENGINE_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid iniset $HEAT_ENGINE_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid
fi fi
# cloudwatch api # Cloudwatch API
HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf
cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF
iniset $HEAT_API_CW_CONF DEFAULT debug True iniset $HEAT_API_CW_CONF DEFAULT debug True

View File

@ -8,7 +8,6 @@
# ``SERVICE_TOKEN`` # ``SERVICE_TOKEN``
# ``S3_SERVICE_PORT`` (template backend only) # ``S3_SERVICE_PORT`` (template backend only)
# ``stack.sh`` calls the entry points in this order: # ``stack.sh`` calls the entry points in this order:
# #
# install_keystone # install_keystone
@ -27,8 +26,6 @@ set +o xtrace
# Defaults # Defaults
# -------- # --------
# <define global variables here that belong to this project>
# Set up default directories # Set up default directories
KEYSTONE_DIR=$DEST/keystone KEYSTONE_DIR=$DEST/keystone
KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone} KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}

View File

@ -1,5 +1,5 @@
# lib/nova # lib/nova
# Functions to control the configuration and operation of the XXXX service # Functions to control the configuration and operation of the **Nova** service
# Dependencies: # Dependencies:
# ``functions`` file # ``functions`` file

View File

@ -1,5 +1,5 @@
# lib/swift # lib/swift
# Functions to control the configuration and operation of the swift service # Functions to control the configuration and operation of the **Swift** service
# Dependencies: # Dependencies:
# ``functions`` file # ``functions`` file
@ -23,10 +23,7 @@ set +o xtrace
# Defaults # Defaults
# -------- # --------
# <define global variables here that belong to this project>
# Set up default directories # Set up default directories
SWIFT_DIR=$DEST/swift SWIFT_DIR=$DEST/swift
SWIFTCLIENT_DIR=$DEST/python-swiftclient SWIFTCLIENT_DIR=$DEST/python-swiftclient
SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift} SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
@ -71,6 +68,7 @@ OBJECT_PORT_BASE=6010
CONTAINER_PORT_BASE=6011 CONTAINER_PORT_BASE=6011
ACCOUNT_PORT_BASE=6012 ACCOUNT_PORT_BASE=6012
# Entry Points # Entry Points
# ------------ # ------------
@ -293,7 +291,6 @@ EOF
sudo chown -R $USER:adm ${swift_log_dir} sudo chown -R $USER:adm ${swift_log_dir}
sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \ sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
tee /etc/rsyslog.d/10-swift.conf tee /etc/rsyslog.d/10-swift.conf
} }
# configure_swiftclient() - Set config files, create data dirs, etc # configure_swiftclient() - Set config files, create data dirs, etc

View File

@ -1,4 +1,5 @@
# lib/tempest # lib/tempest
# Install and configure Tempest
# Dependencies: # Dependencies:
# ``functions`` file # ``functions`` file
@ -23,33 +24,29 @@
# #
# install_tempest # install_tempest
# configure_tempest # configure_tempest
# init_tempest
## start_tempest
## stop_tempest
## cleanup_tempest
# Save trace setting # Save trace setting
XTRACE=$(set +o | grep xtrace) XTRACE=$(set +o | grep xtrace)
set +o xtrace set +o xtrace
# Defaults # Defaults
# -------- # --------
# <define global variables here that belong to this project>
# Set up default directories # Set up default directories
NOVA_SOURCE_DIR=$DEST/nova
TEMPEST_DIR=$DEST/tempest TEMPEST_DIR=$DEST/tempest
TEMPEST_CONF_DIR=$TEMPEST_DIR/etc TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
NOVA_SOURCE_DIR=$DEST/nova
BUILD_INTERVAL=3 BUILD_INTERVAL=3
BUILD_TIMEOUT=400 BUILD_TIMEOUT=400
# Entry Points # Entry Points
# ------------ # ------------
# configure_tempest() - Set config files, create data dirs, etc # configure_tempest() - Set config files, create data dirs, etc
function configure_tempest() { function configure_tempest() {
local image_lines local image_lines
@ -66,7 +63,7 @@ function configure_tempest() {
local public_network_id local public_network_id
local tenant_networks_reachable local tenant_networks_reachable
#TODO(afazekas): # TODO(afazekas):
# sudo python setup.py deploy # sudo python setup.py deploy
# This function exits on an error so that errors don't compound and you see # This function exits on an error so that errors don't compound and you see
@ -74,7 +71,7 @@ function configure_tempest() {
errexit=$(set +o | grep errexit) errexit=$(set +o | grep errexit)
set -o errexit set -o errexit
#Save IFS # Save IFS
ifs=$IFS ifs=$IFS
# Glance should already contain images to be used in tempest # Glance should already contain images to be used in tempest
@ -240,7 +237,6 @@ function configure_tempest() {
$errexit $errexit
} }
# install_tempest() - Collect source and prepare # install_tempest() - Collect source and prepare
function install_tempest() { function install_tempest() {
git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH