Browse code

Formatting cleanups, doc updates and whatnot

Change-Id: Ica8298353be22f947c8e8a03d8dc29ded9cb26dd

Dean Troyer authored on 2013/04/09 05:38:03
Showing 25 changed files
... ...
@@ -7,8 +7,8 @@ General
7 7
 
8 8
 DevStack is written in POSIX shell script.  This choice was made because
9 9
 it best illustrates the configuration steps that this implementation takes
10
-on setting up and interacting with OpenStack components.  DevStack specifies
11
-BASH and is compatible with Bash 3.
10
+on setting up and interacting with OpenStack components.  DevStack specifically
11
+uses Bash and is compatible with Bash 3.
12 12
 
13 13
 DevStack's official repository is located on GitHub at
14 14
 https://github.com/openstack-dev/devstack.git.  Besides the master branch that
... ...
@@ -30,9 +30,17 @@ work for DevStack's use cases.  There is a subscript ``functions`` that contains
30 30
 generally useful shell functions and is used by a number of the scripts in
31 31
 DevStack.
32 32
 
33
+The ``lib`` directory contains sub-scripts for projects or packages that ``stack.sh``
34
+sources to perform much of the work related to those projects.  These sub-scripts
35
+contain configuration defaults and functions to configure, start and stop the project
36
+or package.  These variables and functions are also used by related projects,
37
+such as Grenade, to manage a DevStack installation.
38
+
33 39
 A number of additional scripts can be found in the ``tools`` directory that may
34
-be useful in setting up special-case uses of DevStack. These include: bare metal
35
-deployment, ramdisk deployment and Jenkins integration.
40
+be useful in supporting DevStack installations.  Of particular note are ``info.sh``
41
+to collect and report information about the installed system, and ``instal_prereqs.sh``
42
+that handles installation of the prerequisite packages for DevStack.  It is
43
+suitable, for example, to pre-load a system for making a snapshot.
36 44
 
37 45
 
38 46
 Scripts
... ...
@@ -63,8 +71,8 @@ configuration of the user environment::
63 63
     source $TOP_DIR/openrc
64 64
 
65 65
 ``stack.sh`` is a rather large monolithic script that flows through from beginning
66
-to end.  The process of breaking it down into project-level sub-scripts is nearly
67
-complete and should make ``stack.sh`` easier to read and manage.
66
+to end.  It has been broken down into project-specific subscripts (as noted above)
67
+located in ``lib`` to make ``stack.sh`` more manageable and to promote code reuse.
68 68
 
69 69
 These library sub-scripts have a number of fixed entry points, some of which may
70 70
 just be stubs.  These entry points will be called by ``stack.sh`` in the
... ...
@@ -112,6 +120,7 @@ Also, variable declarations in ``stackrc`` do NOT allow overriding (the form
112 112
 ``FOO=${FOO:-baz}``); if they did then they can already be changed in ``localrc``
113 113
 and can stay in the project file.
114 114
 
115
+
115 116
 Documentation
116 117
 -------------
117 118
 
... ...
@@ -120,14 +120,16 @@ In order to enable Quantum a single node setup, you'll need the following settin
120 120
     # Optional, to enable tempest configuration as part of devstack
121 121
     enable_service tempest
122 122
 
123
-Then run stack.sh as normal.
123
+Then run `stack.sh` as normal.
124
+
125
+# Tempest
124 126
 
125 127
 If tempest has been successfully configured, a basic set of smoke tests can be run as follows:
126 128
 
127 129
     $ cd /opt/stack/tempest
128 130
     $ nosetests tempest/tests/network/test_network_basic_ops.py
129 131
 
130
-Multi-Node Setup
132
+# Multi-Node Setup
131 133
 
132 134
 A more interesting setup involves running multiple compute nodes, with Quantum networks connecting VMs on different compute nodes.
133 135
 You should run at least one "controller node", which should have a `stackrc` that includes at least:
... ...
@@ -23,7 +23,7 @@ basenames=${RUN_EXERCISES:-""}
23 23
 
24 24
 EXERCISE_DIR=$TOP_DIR/exercises
25 25
 
26
-if [ -z "${basenames}" ] ; then
26
+if [[ -z "${basenames}" ]]; then
27 27
     # Locate the scripts we should run
28 28
     basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
29 29
 else
... ...
@@ -38,7 +38,7 @@ skips=""
38 38
 
39 39
 # Loop over each possible script (by basename)
40 40
 for script in $basenames; do
41
-    if [[ ,$SKIP_EXERCISES, =~ ,$script, ]] ; then
41
+    if [[ ,$SKIP_EXERCISES, =~ ,$script, ]]; then
42 42
         skips="$skips $script"
43 43
     else
44 44
         echo "====================================================================="
... ...
@@ -48,7 +48,7 @@ for script in $basenames; do
48 48
         exitcode=$?
49 49
         if [[ $exitcode == 55 ]]; then
50 50
             skips="$skips $script"
51
-        elif [[ $exitcode -ne 0 ]] ; then
51
+        elif [[ $exitcode -ne 0 ]]; then
52 52
             failures="$failures $script"
53 53
         else
54 54
             passes="$passes $script"
... ...
@@ -69,6 +69,6 @@ for script in $failures; do
69 69
 done
70 70
 echo "====================================================================="
71 71
 
72
-if [ -n "$failures" ] ; then
72
+if [[ -n "$failures" ]]; then
73 73
     exit 1
74 74
 fi
... ...
@@ -67,7 +67,7 @@ RETURN=0
67 67
 # Keystone client
68 68
 # ---------------
69 69
 if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
70
-    if [[ "$SKIP_EXERCISES" =~ "key" ]] ; then
70
+    if [[ "$SKIP_EXERCISES" =~ "key" ]]; then
71 71
         STATUS_KEYSTONE="Skipped"
72 72
     else
73 73
         echo -e "\nTest Keystone"
... ...
@@ -84,7 +84,7 @@ fi
84 84
 # -----------
85 85
 
86 86
 if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
87
-    if [[ "$SKIP_EXERCISES" =~ "n-api" ]] ; then
87
+    if [[ "$SKIP_EXERCISES" =~ "n-api" ]]; then
88 88
         STATUS_NOVA="Skipped"
89 89
         STATUS_EC2="Skipped"
90 90
     else
... ...
@@ -103,7 +103,7 @@ fi
103 103
 # -------------
104 104
 
105 105
 if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
106
-    if [[ "$SKIP_EXERCISES" =~ "c-api" ]] ; then
106
+    if [[ "$SKIP_EXERCISES" =~ "c-api" ]]; then
107 107
         STATUS_CINDER="Skipped"
108 108
     else
109 109
         echo -e "\nTest Cinder"
... ...
@@ -120,7 +120,7 @@ fi
120 120
 # -------------
121 121
 
122 122
 if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
123
-    if [[ "$SKIP_EXERCISES" =~ "g-api" ]] ; then
123
+    if [[ "$SKIP_EXERCISES" =~ "g-api" ]]; then
124 124
         STATUS_GLANCE="Skipped"
125 125
     else
126 126
         echo -e "\nTest Glance"
... ...
@@ -137,7 +137,7 @@ fi
137 137
 # ------------
138 138
 
139 139
 if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then
140
-    if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then
140
+    if [[ "$SKIP_EXERCISES" =~ "swift" ]]; then
141 141
         STATUS_SWIFT="Skipped"
142 142
     else
143 143
         echo -e "\nTest Swift"
... ...
@@ -152,8 +152,9 @@ fi
152 152
 
153 153
 set +o xtrace
154 154
 
155
+
155 156
 # Results
156
-# -------
157
+# =======
157 158
 
158 159
 function report() {
159 160
     if [[ -n "$2" ]]; then
... ...
@@ -60,7 +60,7 @@ RETURN=0
60 60
 # Keystone client
61 61
 # ---------------
62 62
 if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
63
-    if [[ "$SKIP_EXERCISES" =~ "key" ]] ; then
63
+    if [[ "$SKIP_EXERCISES" =~ "key" ]]; then
64 64
         STATUS_KEYSTONE="Skipped"
65 65
     else
66 66
         echo -e "\nTest Keystone"
... ...
@@ -77,7 +77,7 @@ fi
77 77
 # -----------
78 78
 
79 79
 if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
80
-    if [[ "$SKIP_EXERCISES" =~ "n-api" ]] ; then
80
+    if [[ "$SKIP_EXERCISES" =~ "n-api" ]]; then
81 81
         STATUS_NOVA="Skipped"
82 82
         STATUS_EC2="Skipped"
83 83
     else
... ...
@@ -111,7 +111,7 @@ fi
111 111
 # -------------
112 112
 
113 113
 if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
114
-    if [[ "$SKIP_EXERCISES" =~ "c-api" ]] ; then
114
+    if [[ "$SKIP_EXERCISES" =~ "c-api" ]]; then
115 115
         STATUS_CINDER="Skipped"
116 116
     else
117 117
         echo -e "\nTest Cinder"
... ...
@@ -128,7 +128,7 @@ fi
128 128
 # -------------
129 129
 
130 130
 if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
131
-    if [[ "$SKIP_EXERCISES" =~ "g-api" ]] ; then
131
+    if [[ "$SKIP_EXERCISES" =~ "g-api" ]]; then
132 132
         STATUS_GLANCE="Skipped"
133 133
     else
134 134
         echo -e "\nTest Glance"
... ...
@@ -146,7 +146,7 @@ fi
146 146
 
147 147
 
148 148
 if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then
149
-    if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then
149
+    if [[ "$SKIP_EXERCISES" =~ "swift" ]]; then
150 150
         STATUS_SWIFT="Skipped"
151 151
     else
152 152
         echo -e "\nTest Swift"
... ...
@@ -161,8 +161,9 @@ fi
161 161
 
162 162
 set +o xtrace
163 163
 
164
+
164 165
 # Results
165
-# -------
166
+# =======
166 167
 
167 168
 function report() {
168 169
     if [[ -n "$2" ]]; then
... ...
@@ -830,7 +830,7 @@ function pip_install {
830 830
     if [[ -z "$os_PACKAGE" ]]; then
831 831
         GetOSVersion
832 832
     fi
833
-    if [[ $TRACK_DEPENDS = True ]] ; then
833
+    if [[ $TRACK_DEPENDS = True ]]; then
834 834
         source $DEST/.venv/bin/activate
835 835
         CMD_PIP=$DEST/.venv/bin/pip
836 836
         SUDO_PIP="env"
... ...
@@ -1005,7 +1005,7 @@ function service_check() {
1005 1005
 # Uses globals ``TRACK_DEPENDES``, ``*_proxy`
1006 1006
 # setup_develop directory
1007 1007
 function setup_develop() {
1008
-    if [[ $TRACK_DEPENDS = True ]] ; then
1008
+    if [[ $TRACK_DEPENDS = True ]]; then
1009 1009
         SUDO_CMD="env"
1010 1010
     else
1011 1011
         SUDO_CMD="sudo"
... ...
@@ -1288,7 +1288,7 @@ function _ssh_check_novanet() {
1288 1288
     local DEFAULT_INSTANCE_USER=$4
1289 1289
     local ACTIVE_TIMEOUT=$5
1290 1290
     local probe_cmd=""
1291
-    if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success ; do sleep 1; done"; then
1291
+    if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success; do sleep 1; done"; then
1292 1292
         die $LINENO "server didn't become ssh-able!"
1293 1293
     fi
1294 1294
 }
... ...
@@ -53,6 +53,7 @@
53 53
 XTRACE=$(set +o | grep xtrace)
54 54
 set +o xtrace
55 55
 
56
+
56 57
 # Sub-driver settings
57 58
 # -------------------
58 59
 
... ...
@@ -37,12 +37,16 @@ CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
37 37
 CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
38 38
 
39 39
 # Support potential entry-points console scripts
40
-if [ -d $CEILOMETER_DIR/bin ] ; then
40
+if [[ -d $CEILOMETER_DIR/bin ]]; then
41 41
     CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
42 42
 else
43 43
     CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
44 44
 fi
45 45
 
46
+
47
+# Functions
48
+# ---------
49
+
46 50
 # cleanup_ceilometer() - Remove residual data files, anything left over from previous
47 51
 # runs that a clean run would need to clean up
48 52
 function cleanup_ceilometer() {
... ...
@@ -93,7 +97,7 @@ function configure_ceilometer() {
93 93
 }
94 94
 
95 95
 function configure_mongodb() {
96
-    if is_fedora ; then
96
+    if is_fedora; then
97 97
         # ensure smallfiles selected to minimize freespace requirements
98 98
         sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod
99 99
 
... ...
@@ -135,6 +139,7 @@ function stop_ceilometer() {
135 135
     done
136 136
 }
137 137
 
138
+
138 139
 # Restore xtrace
139 140
 $XTRACE
140 141
 
... ...
@@ -64,6 +64,10 @@ VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
64 64
 VOLUME_GROUP2=${VOLUME_GROUP2:-stack-volumes2}
65 65
 VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
66 66
 
67
+
68
+# Functions
69
+# ---------
70
+
67 71
 # _clean_volume_group removes all cinder volumes from the specified volume group
68 72
 # _clean_volume_group $VOLUME_GROUP $VOLUME_NAME_PREFIX
69 73
 function _clean_volume_group() {
... ...
@@ -432,6 +436,7 @@ function stop_cinder() {
432 432
     fi
433 433
 }
434 434
 
435
+
435 436
 # Restore xtrace
436 437
 $XTRACE
437 438
 
... ...
@@ -20,14 +20,18 @@
20 20
 XTRACE=$(set +o | grep xtrace)
21 21
 set +o xtrace
22 22
 
23
+
23 24
 # Register a database backend
24 25
 #  $1 The name of the database backend
26
+# This is required to be defined before the specific database scripts are sourced
25 27
 function register_database {
26 28
     [ -z "$DATABASE_BACKENDS" ] && DATABASE_BACKENDS=$1 || DATABASE_BACKENDS+=" $1"
27 29
 }
28 30
 
29 31
 # Sourcing the database libs sets DATABASE_BACKENDS with the available list
30
-for f in $TOP_DIR/lib/databases/*; do source $f; done
32
+for f in $TOP_DIR/lib/databases/*; do
33
+    source $f;
34
+done
31 35
 
32 36
 # ``DATABASE_BACKENDS`` now contains a list of the supported databases
33 37
 # Look in ``ENABLED_SERVICES`` to see if one has been selected
... ...
@@ -42,6 +46,9 @@ done
42 42
 # This is not an error as multi-node installs will do this on the compute nodes
43 43
 
44 44
 
45
+# Functions
46
+# ---------
47
+
45 48
 # Get rid of everything enough to cleanly change database backends
46 49
 function cleanup_database {
47 50
     cleanup_database_$DATABASE_TYPE
... ...
@@ -112,6 +119,7 @@ function database_connection_url {
112 112
     database_connection_url_$DATABASE_TYPE $var $db
113 113
 }
114 114
 
115
+
115 116
 # Restore xtrace
116 117
 $XTRACE
117 118
 
... ...
@@ -8,8 +8,13 @@
8 8
 MY_XTRACE=$(set +o | grep xtrace)
9 9
 set +o xtrace
10 10
 
11
+
11 12
 register_database mysql
12 13
 
14
+
15
+# Functions
16
+# ---------
17
+
13 18
 # Get rid of everything enough to cleanly change database backends
14 19
 function cleanup_database_mysql {
15 20
     if is_ubuntu; then
... ...
@@ -137,6 +142,7 @@ function database_connection_url_mysql {
137 137
     echo "$BASE_SQL_CONN/$db?charset=utf8"
138 138
 }
139 139
 
140
+
140 141
 # Restore xtrace
141 142
 $MY_XTRACE
142 143
 
... ...
@@ -8,8 +8,13 @@
8 8
 PG_XTRACE=$(set +o | grep xtrace)
9 9
 set +o xtrace
10 10
 
11
+
11 12
 register_database postgresql
12 13
 
14
+
15
+# Functions
16
+# ---------
17
+
13 18
 # Get rid of everything enough to cleanly change database backends
14 19
 function cleanup_database_postgresql {
15 20
     stop_service postgresql
... ...
@@ -88,6 +93,7 @@ function database_connection_url_postgresql {
88 88
     echo "$BASE_SQL_CONN/$db?client_encoding=utf8"
89 89
 }
90 90
 
91
+
91 92
 # Restore xtrace
92 93
 $PG_XTRACE
93 94
 
... ...
@@ -51,8 +51,8 @@ fi
51 51
 GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
52 52
 
53 53
 
54
-# Entry Points
55
-# ------------
54
+# Functions
55
+# ---------
56 56
 
57 57
 # cleanup_glance() - Remove residual data files, anything left over from previous
58 58
 # runs that a clean run would need to clean up
... ...
@@ -199,6 +199,7 @@ function stop_glance() {
199 199
     screen -S $SCREEN_NAME -p g-reg -X kill
200 200
 }
201 201
 
202
+
202 203
 # Restore xtrace
203 204
 $XTRACE
204 205
 
... ...
@@ -25,9 +25,14 @@ set +o xtrace
25 25
 
26 26
 # Defaults
27 27
 # --------
28
+
29
+# set up default directories
28 30
 HEAT_DIR=$DEST/heat
29 31
 HEATCLIENT_DIR=$DEST/python-heatclient
30
-# set up default directories
32
+
33
+
34
+# Functions
35
+# ---------
31 36
 
32 37
 # cleanup_heat() - Remove residual data files, anything left over from previous
33 38
 # runs that a clean run would need to clean up
... ...
@@ -182,6 +187,7 @@ function stop_heat() {
182 182
     done
183 183
 }
184 184
 
185
+
185 186
 # Restore xtrace
186 187
 $XTRACE
187 188
 
... ...
@@ -38,6 +38,10 @@ HORIZON_SETTINGS=${HORIZON_SETTINGS:-$HORIZON_DIR/openstack_dashboard/local/loca
38 38
 APACHE_USER=${APACHE_USER:-$USER}
39 39
 APACHE_GROUP=${APACHE_GROUP:-$(id -gn $APACHE_USER)}
40 40
 
41
+
42
+# Functions
43
+# ---------
44
+
41 45
 # utility method of setting python option
42 46
 function _horizon_config_set() {
43 47
     local file=$1
... ...
@@ -63,8 +63,8 @@ KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
63 63
 SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}
64 64
 
65 65
 
66
-# Entry Points
67
-# ------------
66
+# Functions
67
+# ---------
68 68
 
69 69
 # cleanup_keystone() - Remove residual data files, anything left over from previous
70 70
 # runs that a clean run would need to clean up
... ...
@@ -1,13 +1,17 @@
1 1
 # lib/ldap
2 2
 # Functions to control the installation and configuration of **ldap**
3 3
 
4
-# ``stack.sh`` calls the entry points in this order:
5
-#
4
+# ``lib/keystone`` calls the entry points in this order:
5
+# install_ldap()
6 6
 
7 7
 # Save trace setting
8 8
 XTRACE=$(set +o | grep xtrace)
9 9
 set +o xtrace
10 10
 
11
+
12
+# Functions
13
+# ---------
14
+
11 15
 # install_ldap
12 16
 # install_ldap() - Collect source and prepare
13 17
 function install_ldap() {
... ...
@@ -44,7 +48,7 @@ function install_ldap() {
44 44
     fi
45 45
 
46 46
     # add our top level ldap nodes
47
-    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
47
+    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
48 48
         printf "LDAP already configured for OpenStack\n"
49 49
         if [[ "$KEYSTONE_CLEAR_LDAP" == "yes" ]]; then
50 50
             # clear LDAP state
... ...
@@ -122,8 +122,8 @@ TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
122 122
 TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
123 123
 
124 124
 
125
-# Entry Points
126
-# ------------
125
+# Functions
126
+# ---------
127 127
 
128 128
 function add_nova_opt {
129 129
     echo "$1" >>$NOVA_CONF
... ...
@@ -276,7 +276,7 @@ function configure_nova() {
276 276
             configure_baremetal_nova_dirs
277 277
         fi
278 278
 
279
-        if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF ; then
279
+        if is_service_enabled quantum && is_quantum_ovs_base_plugin && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF; then
280 280
             # Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces
281 281
             cat <<EOF | sudo tee -a $QEMU_CONF
282 282
 cgroup_device_acl = [
... ...
@@ -509,7 +509,7 @@ function create_nova_conf() {
509 509
         VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
510 510
     fi
511 511
 
512
-    if is_service_enabled n-novnc || is_service_enabled n-xvnc ; then
512
+    if is_service_enabled n-novnc || is_service_enabled n-xvnc; then
513 513
       # Address on which instance vncservers will listen on compute hosts.
514 514
       # For multi-host, this should be the management ip of the compute host.
515 515
       VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
... ...
@@ -673,6 +673,7 @@ function stop_nova() {
673 673
     done
674 674
 }
675 675
 
676
+
676 677
 # Restore xtrace
677 678
 $XTRACE
678 679
 
... ...
@@ -53,7 +53,6 @@
53 53
 #
54 54
 # With Quantum networking the NETWORK_MANAGER variable is ignored.
55 55
 
56
-
57 56
 # Save trace setting
58 57
 XTRACE=$(set +o | grep xtrace)
59 58
 set +o xtrace
... ...
@@ -172,6 +171,7 @@ if is_service_enabled quantum; then
172 172
     OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
173 173
 fi
174 174
 
175
+
175 176
 # Quantum plugin specific functions
176 177
 # ---------------------------------
177 178
 # Please refer to lib/quantum_plugins/README.md for details.
... ...
@@ -189,8 +189,9 @@ else
189 189
     Q_USE_SECGROUP=False
190 190
 fi
191 191
 
192
-# Entry Points
193
-# ------------
192
+
193
+# Functions
194
+# ---------
194 195
 
195 196
 # configure_quantum()
196 197
 # Set common config for all quantum server and agents.
... ...
@@ -730,7 +731,7 @@ function _ssh_check_quantum() {
730 730
     local timeout_sec=$5
731 731
     local probe_cmd = ""
732 732
     probe_cmd=`_get_probe_cmd_prefix $from_net`
733
-    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
733
+    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
734 734
         die $LINENO "server didn't become ssh-able!"
735 735
     fi
736 736
 }
... ...
@@ -17,8 +17,9 @@
17 17
 XTRACE=$(set +o | grep xtrace)
18 18
 set +o xtrace
19 19
 
20
-# Entry Points
21
-# ------------
20
+
21
+# Functions
22
+# ---------
22 23
 
23 24
 # Make sure we only have one rpc backend enabled.
24 25
 # Also check the specified rpc backend is available on your platform.
... ...
@@ -157,6 +158,7 @@ function qpid_is_supported() {
157 157
     ( ! ([[ "$DISTRO" = "oneiric" ]] || is_suse) )
158 158
 }
159 159
 
160
+
160 161
 # Restore xtrace
161 162
 $XTRACE
162 163
 
... ...
@@ -84,8 +84,8 @@ CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
84 84
 ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
85 85
 
86 86
 
87
-# Entry Points
88
-# ------------
87
+# Functions
88
+# ---------
89 89
 
90 90
 # cleanup_swift() - Remove residual data files
91 91
 function cleanup_swift() {
... ...
@@ -50,8 +50,9 @@ BUILD_TIMEOUT=400
50 50
 
51 51
 BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
52 52
 
53
-# Entry Points
54
-# ------------
53
+
54
+# Functions
55
+# ---------
55 56
 
56 57
 # configure_tempest() - Set config files, create data dirs, etc
57 58
 function configure_tempest() {
... ...
@@ -21,6 +21,9 @@
21 21
 # start_tls_proxy HOST_IP 5000 localhost 5000
22 22
 
23 23
 
24
+# Defaults
25
+# --------
26
+
24 27
 if is_service_enabled tls-proxy; then
25 28
     # TODO(dtroyer): revisit this below after the search for HOST_IP has been done
26 29
     TLS_IP=${TLS_IP:-$SERVICE_IP}
... ...
@@ -317,6 +320,7 @@ function start_tls_proxy() {
317 317
     stud $STUD_PROTO -f $f_host,$f_port -b $b_host,$b_port $DEVSTACK_CERT 2>/dev/null
318 318
 }
319 319
 
320
+
320 321
 # Local variables:
321 322
 # mode: shell-script
322 323
 # End:
... ...
@@ -12,7 +12,7 @@
12 12
 # developer install.
13 13
 
14 14
 # To keep this script simple we assume you are running on a recent **Ubuntu**
15
-# (11.10 Oneiric or newer) or **Fedora** (F16 or newer) machine.  It
15
+# (12.04 Precise or newer) or **Fedora** (F16 or newer) machine.  It
16 16
 # should work in a VM or physical server.  Additionally we put the list of
17 17
 # ``apt`` and ``rpm`` dependencies and other configuration files in this repo.
18 18
 
... ...
@@ -51,8 +51,8 @@ GetDistro
51 51
 # be overwritten by a DevStack update.
52 52
 #
53 53
 # DevStack distributes ``stackrc`` which contains locations for the OpenStack
54
-# repositories and branches to configure.  ``stackrc`` sources ``localrc`` to
55
-# allow you to safely override those settings.
54
+# repositories, branches to configure, and other configuration defaults.
55
+# ``stackrc`` sources ``localrc`` to allow you to safely override those settings.
56 56
 
57 57
 if [[ ! -r $TOP_DIR/stackrc ]]; then
58 58
     log_error $LINENO "missing $TOP_DIR/stackrc - did you grab more than just stack.sh?"
... ...
@@ -78,6 +78,19 @@ if [[ -r $TOP_DIR/.stackenv ]]; then
78 78
     rm $TOP_DIR/.stackenv
79 79
 fi
80 80
 
81
+# ``stack.sh`` keeps the list of ``apt`` and ``rpm`` dependencies and config
82
+# templates and other useful files in the ``files`` subdirectory
83
+FILES=$TOP_DIR/files
84
+if [ ! -d $FILES ]; then
85
+    log_error $LINENO "missing devstack/files"
86
+fi
87
+
88
+# ``stack.sh`` keeps function libraries here
89
+# Make sure ``$TOP_DIR/lib`` directory is present
90
+if [ ! -d $TOP_DIR/lib ]; then
91
+    log_error $LINENO "missing devstack/lib"
92
+fi
93
+
81 94
 # Import common services (database, message queue) configuration
82 95
 source $TOP_DIR/lib/database
83 96
 source $TOP_DIR/lib/rpc_backend
... ...
@@ -100,21 +113,9 @@ fi
100 100
 # and the specified rpc backend is available on your platform.
101 101
 check_rpc_backend
102 102
 
103
-# ``stack.sh`` keeps function libraries here
104
-# Make sure ``$TOP_DIR/lib`` directory is present
105
-if [ ! -d $TOP_DIR/lib ]; then
106
-    log_error $LINENO "missing devstack/lib"
107
-fi
108
-
109
-# ``stack.sh`` keeps the list of ``apt`` and ``rpm`` dependencies and config
110
-# templates and other useful files in the ``files`` subdirectory
111
-FILES=$TOP_DIR/files
112
-if [ ! -d $FILES ]; then
113
-    log_error $LINENO "missing devstack/files"
114
-fi
115
-
116 103
 SCREEN_NAME=${SCREEN_NAME:-stack}
117 104
 # Check to see if we are already running DevStack
105
+# Note that this may fail if USE_SCREEN=False
118 106
 if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].$SCREEN_NAME"; then
119 107
     echo "You are already running a stack.sh session."
120 108
     echo "To rejoin this session type 'screen -x stack'."
... ...
@@ -230,6 +231,8 @@ fi
230 230
 
231 231
 # Allow the use of an alternate hostname (such as localhost/127.0.0.1) for service endpoints.
232 232
 SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
233
+
234
+# Allow the use of an alternate protocol (such as https) for service endpoints
233 235
 SERVICE_PROTOCOL=${SERVICE_PROTOCOL:-http}
234 236
 
235 237
 # Configure services to use syslog instead of writing to individual log files
... ...
@@ -241,7 +244,6 @@ SYSLOG_PORT=${SYSLOG_PORT:-516}
241 241
 SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
242 242
 SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
243 243
 
244
-
245 244
 # Use color for logging output (only available if syslog is not used)
246 245
 LOG_COLOR=`trueorfalse True $LOG_COLOR`
247 246
 
... ...
@@ -267,7 +269,6 @@ source $TOP_DIR/lib/baremetal
267 267
 source $TOP_DIR/lib/ldap
268 268
 
269 269
 # Set the destination directories for OpenStack projects
270
-HORIZON_DIR=$DEST/horizon
271 270
 OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
272 271
 
273 272
 
... ...
@@ -545,7 +546,7 @@ fi
545 545
 TRACK_DEPENDS=${TRACK_DEPENDS:-False}
546 546
 
547 547
 # Install python packages into a virtualenv so that we can track them
548
-if [[ $TRACK_DEPENDS = True ]] ; then
548
+if [[ $TRACK_DEPENDS = True ]]; then
549 549
     echo_summary "Installing Python packages into a virtualenv $DEST/.venv"
550 550
     install_package python-virtualenv
551 551
 
... ...
@@ -651,9 +652,9 @@ if is_service_enabled tls-proxy; then
651 651
     # don't be naive and add to existing line!
652 652
 fi
653 653
 
654
-if [[ $TRACK_DEPENDS = True ]] ; then
654
+if [[ $TRACK_DEPENDS = True ]]; then
655 655
     $DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
656
-    if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff ; then
656
+    if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then
657 657
         cat $DEST/requires.diff
658 658
     fi
659 659
     echo "Ran stack.sh in depend tracking mode, bailing out now"
... ...
@@ -719,10 +720,10 @@ if [[ -e $SCREENRC ]]; then
719 719
     echo -n > $SCREENRC
720 720
 fi
721 721
 
722
-
723 722
 # Initialize the directory for service status check
724 723
 init_service_check
725 724
 
725
+
726 726
 # Kick off Sysstat
727 727
 # ------------------------
728 728
 # run sysstat if it is enabled, this has to be early as daemon
... ...
@@ -735,6 +736,7 @@ if is_service_enabled sysstat;then
735 735
     fi
736 736
 fi
737 737
 
738
+
738 739
 # Keystone
739 740
 # --------
740 741
 
... ...
@@ -49,6 +49,7 @@ if [ -f $RC_DIR/localrc ]; then
49 49
     source $RC_DIR/localrc
50 50
 fi
51 51
 
52
+
52 53
 # Repositories
53 54
 # ------------
54 55
 
... ...
@@ -156,7 +157,6 @@ BM_IMAGE_BUILD_BRANCH=${BM_IMAGE_BUILD_BRANCH:-master}
156 156
 BM_POSEUR_REPO=${BM_POSEUR_REPO:-${GIT_BASE}/tripleo/bm_poseur.git}
157 157
 BM_POSEUR_BRANCH=${BM_POSEUR_BRANCH:-master}
158 158
 
159
-
160 159
 # Nova hypervisor configuration.  We default to libvirt with **kvm** but will
161 160
 # drop back to **qemu** if we are unable to load the kvm module.  ``stack.sh`` can
162 161
 # also install an **LXC** or **OpenVZ** based system.