Cosmetic, comment and text cleanups

* functions
* stack.sh
* stackrc
* unstack.sh

A recent commit to stack.sh broke the RST formatting done by shocco to
produce the HTML-formatted files on devstack.org.  A bunch of comment
and spacing fixes were done (ala pep8 if there were such a thing for
shell scripts).

The only non-comment changes made were to the content of some error
messages.

Fixes bug 1042271

Change-Id: Id1c74cf25c03c4f18ed741f8026e36b0d4a598dd
diff --git a/stackrc b/stackrc
index d8d1008..3002c46 100644
--- a/stackrc
+++ b/stackrc
@@ -1,3 +1,5 @@
+# stackrc
+#
 # Find the other rc files
 RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
 
@@ -5,21 +7,22 @@
 DEST=/opt/stack
 
 # Specify which services to launch.  These generally correspond to
-# screen tabs. If you like to add other services that are not enabled
-# by default you can append them in your ENABLED_SERVICES variable in
-# your localrc. For example for swift you can just add this in your
-# localrc to add it with the other services:
-# ENABLED_SERVICES+=,swift
+# screen tabs. To change the default list, use the ``enable_service`` and
+# ``disable_service`` functions in ``localrc``.
+# For example, to enable Swift add this to ``localrc``:
+# enable_service swift
 #
-# If you like to explicitly remove services you can add a -$service in
-# ENABLED_SERVICES, for example in your localrc to install all defaults but not
-# cinder you would just need to set this :
-# ENABLED_SERVICES+=,-cinder
+# And to disable Cinder and use Nova Volumes instead:
+# disable_service c-api c-sch c-vol cinder
+# enable_service n-vol
 ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit
 
 # Set the default Nova APIs to enable
 NOVA_ENABLED_APIS=ec2,osapi_compute,osapi_volume,metadata
 
+# Repositories
+# ------------
+
 # Base GIT Repo URL
 # Another option is http://review.openstack.org/p
 GIT_BASE=https://github.com
@@ -46,7 +49,6 @@
 SWIFT3_REPO=https://github.com/fujita/swift3.git
 SWIFT3_BRANCH=master
 
-
 # python swift client library
 SWIFTCLIENT_REPO=${GIT_BASE}/openstack/python-swiftclient
 SWIFTCLIENT_BRANCH=master
@@ -75,7 +77,7 @@
 NOVACLIENT_REPO=${GIT_BASE}/openstack/python-novaclient.git
 NOVACLIENT_BRANCH=master
 
-# Shared openstack python client library
+# consolidated openstack python client
 OPENSTACKCLIENT_REPO=${GIT_BASE}/openstack/python-openstackclient.git
 OPENSTACKCLIENT_BRANCH=master
 
@@ -110,7 +112,7 @@
     source $RC_DIR/localrc
 fi
 
-# Specify a comma-separated list of uec images to download and install into glance.
+# Specify a comma-separated list of UEC images to download and install into glance.
 # supported urls here are:
 #  * "uec-style" images:
 #     If the file ends in .tar.gz, uncompress the tarball and and select the first
@@ -123,13 +125,17 @@
 #    example:
 #      http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-armel-disk1.img
 #      http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-rootfs.img.gz
+#  * OpenVZ image:
+#    OpenVZ uses its own format of image, and does not support UEC style images
+
 #IMAGE_URLS="http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz" # old ttylinux-uec image
 #IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" # cirros full disk image
-#
-# Set default image based on LIBVIRT_TYPE or VIRT_DRIVER, which may be set in localrc
-# but allow DEFAULT_IMAGE_NAME and IMAGE_URLS to be set directly in localrc, too.
+
+# Set default image based on ``VIRT_DRIVER`` and ``LIBVIRT_TYPE``, either of
+# which may be set in ``localrc``.  Also allow ``DEFAULT_IMAGE_NAME`` and 
+# ``IMAGE_URLS`` to be set directly in ``localrc``.
 case "$VIRT_DRIVER" in
-    openvz) # OpenVZ uses its own format of image, and does not support uec style images
+    openvz) 
         DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ubuntu-11.10-x86_64}
         IMAGE_URLS=${IMAGE_URLS:-"http://download.openvz.org/template/precreated/ubuntu-11.10-x86_64.tar.gz"};;
     libvirt)