Browse code

Holiday docs and comment formatting cleanup

Change-Id: Ia4ca88c67d3b94e306a79a669805a2fa1b0dc069

Dean Troyer authored on 2012/12/22 02:03:37
Showing 12 changed files
... ...
@@ -15,6 +15,16 @@ https://github.com/openstack-dev/devstack.git.  Besides the master branch that
15 15
 tracks the OpenStack trunk branches a separate branch is maintained for all
16 16
 OpenStack releases starting with Diablo (stable/diablo).
17 17
 
18
+Contributing code to DevStack follows the usual OpenStack process as described
19
+in `How To Contribute`__ in the OpenStack wiki.  `DevStack's LaunchPad project`__
20
+contains the usual links for blueprints, bugs, tec.
21
+
22
+__ contribute_
23
+.. _contribute: http://wiki.openstack.org/HowToContribute.
24
+
25
+__ lp_
26
+.. _lp: https://launchpad.net/~devstack
27
+
18 28
 The primary script in DevStack is ``stack.sh``, which performs the bulk of the
19 29
 work for DevStack's use cases.  There is a subscript ``functions`` that contains
20 30
 generally useful shell functions and is used by a number of the scripts in
... ...
@@ -53,8 +63,8 @@ configuration of the user environment::
53 53
     source $TOP_DIR/openrc
54 54
 
55 55
 ``stack.sh`` is a rather large monolithic script that flows through from beginning
56
-to end.  The process of breaking it down into project-level sub-scripts has begun
57
-with the introduction of ``lib/cinder`` and ``lib/ceilometer``.
56
+to end.  The process of breaking it down into project-level sub-scripts is nearly
57
+complete and should make ``stack.sh`` easier to read and manage.
58 58
 
59 59
 These library sub-scripts have a number of fixed entry points, some of which may
60 60
 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
71 71
 service sub-scripts.  The comments in ``<>`` are meta comments describing
72 72
 how to use the template and should be removed.
73 73
 
74
+In order to show the dependencies and conditions under which project functions
75
+are executed the top-level conditional testing for things like ``is_service_enabled``
76
+should be done in ``stack.sh``.  There may be nested conditionals that need
77
+to be in the sub-script, such as testing for keystone being enabled in
78
+``configure_swift()``.
79
+
74 80
 
75 81
 Documentation
76 82
 -------------
... ...
@@ -1,10 +1,9 @@
1 1
 #!/usr/bin/env bash
2 2
 #
3 3
 
4
-# **quantum.sh**
4
+# **quantum-adv-test.sh**
5 5
 
6
-# We will use this test to perform integration testing of nova and
7
-# other components with Quantum.
6
+# Perform integration testing of Nova and other components with Quantum.
8 7
 
9 8
 echo "*********************************************************************"
10 9
 echo "Begin DevStack Exercise: $0"
... ...
@@ -14,6 +13,7 @@ echo "*********************************************************************"
14 14
 # only the first error that occured.
15 15
 
16 16
 set -o errtrace
17
+
17 18
 trap failed ERR
18 19
 failed() {
19 20
     local r=$?
... ...
@@ -30,17 +30,8 @@ failed() {
30 30
 # an error.  It is also useful for following allowing as the install occurs.
31 31
 set -o xtrace
32 32
 
33
-#------------------------------------------------------------------------------
34
-# Quantum config check
35
-#------------------------------------------------------------------------------
36
-# Warn if quantum is not enabled
37
-if [[ ! "$ENABLED_SERVICES" =~ "q-svc" ]]; then
38
-    echo "WARNING: Running quantum test without enabling quantum"
39
-fi
40
-
41
-#------------------------------------------------------------------------------
42 33
 # Environment
43
-#------------------------------------------------------------------------------
34
+# -----------
44 35
 
45 36
 # Keep track of the current directory
46 37
 EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
... ...
@@ -62,9 +53,8 @@ source $TOP_DIR/lib/quantum
62 62
 # Import exercise configuration
63 63
 source $TOP_DIR/exerciserc
64 64
 
65
-#------------------------------------------------------------------------------
66
-# Test settings for quantum
67
-#------------------------------------------------------------------------------
65
+# Quantum Settings
66
+# ----------------
68 67
 
69 68
 TENANTS="DEMO1"
70 69
 # TODO (nati)_Test public network
... ...
@@ -106,24 +96,17 @@ PUBLIC_ROUTER1_NET="admin-net1"
106 106
 DEMO1_ROUTER1_NET="demo1-net1"
107 107
 DEMO2_ROUTER1_NET="demo2-net1"
108 108
 
109
-#------------------------------------------------------------------------------
110
-# Keystone settings.
111
-#------------------------------------------------------------------------------
112 109
 KEYSTONE="keystone"
113 110
 
114
-#------------------------------------------------------------------------------
115
-# Get a token for clients that don't support service catalog
116
-#------------------------------------------------------------------------------
117
-
118
-# manually create a token by querying keystone (sending JSON data).  Keystone
111
+# Manually create a token by querying keystone (sending JSON data).  Keystone
119 112
 # returns a token and catalog of endpoints.  We use python to parse the token
120 113
 # and save it.
121 114
 
122 115
 TOKEN=`keystone token-get | grep ' id ' | awk '{print $4}'`
123 116
 
124
-#------------------------------------------------------------------------------
125
-# Various functions.
126
-#------------------------------------------------------------------------------
117
+# Various functions
118
+# -----------------
119
+
127 120
 function foreach_tenant {
128 121
     COMMAND=$1
129 122
     for TENANT in ${TENANTS//,/ };do
... ...
@@ -192,10 +175,9 @@ function get_flavor_id {
192 192
 function confirm_server_active {
193 193
     local VM_UUID=$1
194 194
     if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
195
-    echo "server '$VM_UUID' did not become active!"
196
-    false
197
-fi
198
-
195
+        echo "server '$VM_UUID' did not become active!"
196
+        false
197
+    fi
199 198
 }
200 199
 
201 200
 function add_tenant {
... ...
@@ -214,23 +196,15 @@ function add_tenant {
214 214
 function remove_tenant {
215 215
     local TENANT=$1
216 216
     local TENANT_ID=$(get_tenant_id $TENANT)
217
-
218 217
     $KEYSTONE tenant-delete $TENANT_ID
219 218
 }
220 219
 
221 220
 function remove_user {
222 221
     local USER=$1
223 222
     local USER_ID=$(get_user_id $USER)
224
-
225 223
     $KEYSTONE user-delete $USER_ID
226 224
 }
227 225
 
228
-
229
-
230
-#------------------------------------------------------------------------------
231
-# "Create" functions
232
-#------------------------------------------------------------------------------
233
-
234 226
 function create_tenants {
235 227
     source $TOP_DIR/openrc admin admin
236 228
     add_tenant demo1 demo1 demo1
... ...
@@ -383,9 +357,9 @@ function all {
383 383
     delete_all
384 384
 }
385 385
 
386
-#------------------------------------------------------------------------------
387
-# Test functions.
388
-#------------------------------------------------------------------------------
386
+# Test functions
387
+# --------------
388
+
389 389
 function test_functions {
390 390
     IMAGE=$(get_image_id)
391 391
     echo $IMAGE
... ...
@@ -400,9 +374,9 @@ function test_functions {
400 400
     echo $NETWORK_ID
401 401
 }
402 402
 
403
-#------------------------------------------------------------------------------
404
-# Usage and main.
405
-#------------------------------------------------------------------------------
403
+# Usage and main
404
+# --------------
405
+
406 406
 usage() {
407 407
     echo "$0: [-h]"
408 408
     echo "  -h, --help              Display help message"
... ...
@@ -473,10 +447,9 @@ main() {
473 473
     fi
474 474
 }
475 475
 
476
+# Kick off script
477
+# ---------------
476 478
 
477
-#-------------------------------------------------------------------------------
478
-# Kick off script.
479
-#-------------------------------------------------------------------------------
480 479
 echo $*
481 480
 main $*
482 481
 
... ...
@@ -1,9 +1,9 @@
1 1
 # lib/ceilometer
2
-# Install and start Ceilometer service
2
+# Install and start **Ceilometer** service
3
+
3 4
 # To enable, add the following to localrc
4 5
 # ENABLED_SERVICES+=ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
5 6
 
6
-
7 7
 # Dependencies:
8 8
 # - functions
9 9
 # - OS_AUTH_URL for auth in api
... ...
@@ -12,12 +12,12 @@
12 12
 
13 13
 # stack.sh
14 14
 # ---------
15
-# install_XXX
16
-# configure_XXX
17
-# init_XXX
18
-# start_XXX
19
-# stop_XXX
20
-# cleanup_XXX
15
+# install_ceilometer
16
+# configure_ceilometer
17
+# init_ceilometer
18
+# start_ceilometer
19
+# stop_ceilometer
20
+# cleanup_ceilometer
21 21
 
22 22
 # Save trace setting
23 23
 XTRACE=$(set +o | grep xtrace)
... ...
@@ -27,17 +27,18 @@ set +o xtrace
27 27
 # Defaults
28 28
 # --------
29 29
 
30
-# set up default directories
30
+# Set up default directories
31 31
 CEILOMETER_DIR=$DEST/ceilometer
32
+CEILOMETER_CONF_DIR=/etc/ceilometer
33
+CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
34
+CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
35
+
32 36
 # Support potential entry-points console scripts
33 37
 if [ -d $CEILOMETER_DIR/bin ] ; then
34 38
     CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
35 39
 else
36 40
     CEILOMETER_BIN_DIR=/usr/local/bin
37 41
 fi
38
-CEILOMETER_CONF_DIR=/etc/ceilometer
39
-CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
40
-CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
41 42
 
42 43
 # cleanup_ceilometer() - Remove residual data files, anything left over from previous
43 44
 # runs that a clean run would need to clean up
... ...
@@ -1,5 +1,5 @@
1 1
 # lib/cinder
2
-# Install and start Cinder volume service
2
+# Install and start **Cinder** volume service
3 3
 
4 4
 # Dependencies:
5 5
 # - functions
... ...
@@ -1,5 +1,5 @@
1
-# lib/mysql
2
-# Functions to control the configuration and operation of the MySQL database backend
1
+# lib/databases/mysql
2
+# Functions to control the configuration and operation of the **MySQL** database backend
3 3
 
4 4
 # Dependencies:
5 5
 # DATABASE_{HOST,USER,PASSWORD} must be defined
... ...
@@ -1,5 +1,5 @@
1
-# lib/postgresql
2
-# Functions to control the configuration and operation of the PostgreSQL database backend
1
+# lib/databases/postgresql
2
+# Functions to control the configuration and operation of the **PostgreSQL** database backend
3 3
 
4 4
 # Dependencies:
5 5
 # DATABASE_{HOST,USER,PASSWORD} must be defined
... ...
@@ -1,5 +1,5 @@
1 1
 # lib/glance
2
-# Functions to control the configuration and operation of the Glance service
2
+# Functions to control the configuration and operation of the **Glance** service
3 3
 
4 4
 # Dependencies:
5 5
 # ``functions`` file
... ...
@@ -25,8 +25,6 @@ set +o xtrace
25 25
 # Defaults
26 26
 # --------
27 27
 
28
-# <define global variables here that belong to this project>
29
-
30 28
 # Set up default directories
31 29
 GLANCE_DIR=$DEST/glance
32 30
 GLANCECLIENT_DIR=$DEST/python-glanceclient
... ...
@@ -141,7 +139,6 @@ function configure_glance() {
141 141
     iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD
142 142
 
143 143
     cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
144
-
145 144
 }
146 145
 
147 146
 # init_glance() - Initialize databases, etc.
... ...
@@ -1,5 +1,6 @@
1 1
 # lib/heat
2
-# Install and start Heat service
2
+# Install and start **Heat** service
3
+
3 4
 # To enable, add the following to localrc
4 5
 # ENABLED_SERVICES+=,heat,h-api-cfn,h-api-cw,h-eng
5 6
 
... ...
@@ -8,12 +9,14 @@
8 8
 
9 9
 # stack.sh
10 10
 # ---------
11
-# install_XXX
12
-# configure_XXX
13
-# init_XXX
14
-# start_XXX
15
-# stop_XXX
16
-# cleanup_XXX
11
+# install_heatclient
12
+# install_heat
13
+# configure_heatclient
14
+# configure_heat
15
+# init_heat
16
+# start_heat
17
+# stop_heat
18
+# cleanup_heat
17 19
 
18 20
 # Save trace setting
19 21
 XTRACE=$(set +o | grep xtrace)
... ...
@@ -57,7 +60,7 @@ function configure_heat() {
57 57
     HEAT_API_HOST=${HEAT_API_HOST:-$SERVICE_HOST}
58 58
     HEAT_API_PORT=${HEAT_API_PORT:-8004}
59 59
 
60
-    # cloudformation api
60
+    # Cloudformation API
61 61
     HEAT_API_CFN_CONF=$HEAT_CONF_DIR/heat-api-cfn.conf
62 62
     cp $HEAT_DIR/etc/heat/heat-api-cfn.conf $HEAT_API_CFN_CONF
63 63
     iniset $HEAT_API_CFN_CONF DEFAULT debug True
... ...
@@ -86,7 +89,7 @@ function configure_heat() {
86 86
     iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
87 87
     iniset $HEAT_API_CFN_PASTE_INI filter:ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
88 88
 
89
-    # openstack api
89
+    # OpenStack API
90 90
     HEAT_API_CONF=$HEAT_CONF_DIR/heat-api.conf
91 91
     cp $HEAT_DIR/etc/heat/heat-api.conf $HEAT_API_CONF
92 92
     iniset $HEAT_API_CONF DEFAULT debug True
... ...
@@ -139,7 +142,7 @@ function configure_heat() {
139 139
         iniset $HEAT_ENGINE_CONF DEFAULT rpc_backend heat.openstack.common.rpc.impl_qpid
140 140
     fi
141 141
 
142
-    # cloudwatch api
142
+    # Cloudwatch API
143 143
     HEAT_API_CW_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch.conf
144 144
     cp $HEAT_DIR/etc/heat/heat-api-cloudwatch.conf $HEAT_API_CW_CONF
145 145
     iniset $HEAT_API_CW_CONF DEFAULT debug True
... ...
@@ -8,7 +8,6 @@
8 8
 # ``SERVICE_TOKEN``
9 9
 # ``S3_SERVICE_PORT`` (template backend only)
10 10
 
11
-
12 11
 # ``stack.sh`` calls the entry points in this order:
13 12
 #
14 13
 # install_keystone
... ...
@@ -27,8 +26,6 @@ set +o xtrace
27 27
 # Defaults
28 28
 # --------
29 29
 
30
-# <define global variables here that belong to this project>
31
-
32 30
 # Set up default directories
33 31
 KEYSTONE_DIR=$DEST/keystone
34 32
 KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
... ...
@@ -1,5 +1,5 @@
1 1
 # lib/nova
2
-# Functions to control the configuration and operation of the XXXX service
2
+# Functions to control the configuration and operation of the **Nova** service
3 3
 
4 4
 # Dependencies:
5 5
 # ``functions`` file
... ...
@@ -1,5 +1,5 @@
1 1
 # lib/swift
2
-# Functions to control the configuration and operation of the swift service
2
+# Functions to control the configuration and operation of the **Swift** service
3 3
 
4 4
 # Dependencies:
5 5
 # ``functions`` file
... ...
@@ -23,10 +23,7 @@ set +o xtrace
23 23
 # Defaults
24 24
 # --------
25 25
 
26
-# <define global variables here that belong to this project>
27
-
28 26
 # Set up default directories
29
-
30 27
 SWIFT_DIR=$DEST/swift
31 28
 SWIFTCLIENT_DIR=$DEST/python-swiftclient
32 29
 SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
... ...
@@ -71,6 +68,7 @@ OBJECT_PORT_BASE=6010
71 71
 CONTAINER_PORT_BASE=6011
72 72
 ACCOUNT_PORT_BASE=6012
73 73
 
74
+
74 75
 # Entry Points
75 76
 # ------------
76 77
 
... ...
@@ -293,7 +291,6 @@ EOF
293 293
     sudo chown -R $USER:adm ${swift_log_dir}
294 294
     sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
295 295
         tee /etc/rsyslog.d/10-swift.conf
296
-
297 296
 }
298 297
 
299 298
 # configure_swiftclient() - Set config files, create data dirs, etc
... ...
@@ -1,4 +1,5 @@
1 1
 # lib/tempest
2
+# Install and configure Tempest
2 3
 
3 4
 # Dependencies:
4 5
 # ``functions`` file
... ...
@@ -23,33 +24,29 @@
23 23
 #
24 24
 # install_tempest
25 25
 # configure_tempest
26
-# init_tempest
27
-## start_tempest
28
-## stop_tempest
29
-## cleanup_tempest
30 26
 
31 27
 # Save trace setting
32 28
 XTRACE=$(set +o | grep xtrace)
33 29
 set +o xtrace
34 30
 
31
+
35 32
 # Defaults
36 33
 # --------
37 34
 
38
-# <define global variables here that belong to this project>
39
-
40 35
 # Set up default directories
41
-NOVA_SOURCE_DIR=$DEST/nova
42 36
 TEMPEST_DIR=$DEST/tempest
43 37
 TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
44 38
 TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
45 39
 
40
+NOVA_SOURCE_DIR=$DEST/nova
41
+
46 42
 BUILD_INTERVAL=3
47 43
 BUILD_TIMEOUT=400
48 44
 
45
+
49 46
 # Entry Points
50 47
 # ------------
51 48
 
52
-
53 49
 # configure_tempest() - Set config files, create data dirs, etc
54 50
 function configure_tempest() {
55 51
     local image_lines
... ...
@@ -66,7 +63,7 @@ function configure_tempest() {
66 66
     local public_network_id
67 67
     local tenant_networks_reachable
68 68
 
69
-    #TODO(afazekas):
69
+    # TODO(afazekas):
70 70
     # sudo python setup.py deploy
71 71
 
72 72
     # This function exits on an error so that errors don't compound and you see
... ...
@@ -74,7 +71,7 @@ function configure_tempest() {
74 74
     errexit=$(set +o | grep errexit)
75 75
     set -o errexit
76 76
 
77
-    #Save IFS
77
+    # Save IFS
78 78
     ifs=$IFS
79 79
 
80 80
     # Glance should already contain images to be used in tempest
... ...
@@ -240,7 +237,6 @@ function configure_tempest() {
240 240
     $errexit
241 241
 }
242 242
 
243
-
244 243
 # install_tempest() - Collect source and prepare
245 244
 function install_tempest() {
246 245
     git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH