From 7d28a0e1fceae826b4c25fbd4236bcb547ade92d Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 27 Jun 2012 17:55:52 -0500 Subject: [PATCH] Cleanup stack/unstack * whitespace and comment cleanups only Change-Id: I31b3057657bb3bc5c4e085886ef6ac561967706f --- stack.sh | 57 ++++++++++++++++++++++++++++++------------------------ unstack.sh | 4 +++- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/stack.sh b/stack.sh index f71283e1b6..513f8be4a1 100755 --- a/stack.sh +++ b/stack.sh @@ -245,7 +245,6 @@ sudo chown `whoami` $DATA_DIR # Get project function libraries source $TOP_DIR/lib/cinder - # Set the destination directories for openstack projects NOVA_DIR=$DEST/nova HORIZON_DIR=$DEST/horizon @@ -463,9 +462,9 @@ fi GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292} -# SWIFT +# Swift # ----- -# TODO: implement glance support + # TODO: add logging to different location. # By default the location of swift drives and objects is located inside @@ -477,7 +476,7 @@ SWIFT_DATA_DIR=${SWIFT_DATA_DIR:-${DEST}/data/swift} # directory, change SWIFT_CONFIG_DIR if you want to adjust that. SWIFT_CONFIG_DIR=${SWIFT_CONFIG_DIR:-/etc/swift} -# devstack will create a loop-back disk formatted as XFS to store the +# DevStack will create a loop-back disk formatted as XFS to store the # swift data. By default the disk size is 1 gigabyte. The variable # SWIFT_LOOPBACK_DISK_SIZE specified in bytes allow you to change # that. @@ -512,6 +511,7 @@ fi # Set default port for nova-objectstore S3_SERVICE_PORT=${S3_SERVICE_PORT:-3333} + # Keystone # -------- @@ -609,10 +609,10 @@ set -o xtrace # Install Packages # ================ -# + # Openstack uses a fair number of other projects. -# install package requirements +# Install package requirements if [[ "$os_PACKAGE" = "deb" ]]; then apt_get update install_package $(get_packages $FILES/apts) @@ -620,12 +620,13 @@ else install_package $(get_packages $FILES/rpms) fi -# install python requirements +# Install python requirements pip_install $(get_packages $FILES/pips | sort -u) -# compute service +# Check out OpenStack sources git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH -# python client library to nova that horizon (and others) use + +# Check out the client libs that are used most git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH @@ -678,7 +679,7 @@ fi # Initialization # ============== -# setup our checkouts so they are installed into python path +# Set up our checkouts so they are installed into python path # allowing ``import nova`` or ``import glance.client`` setup_develop $KEYSTONECLIENT_DIR setup_develop $NOVACLIENT_DIR @@ -874,16 +875,17 @@ function screen_it { fi } -# create a new named screen to run processes in +# Create a new named screen to run processes in screen -d -m -S stack -t stack -s /bin/bash sleep 1 -# set a reasonable statusbar +# Set a reasonable statusbar screen -r stack -X hardstatus alwayslastline "$SCREEN_HARDSTATUS" + # Horizon # ------- -# Setup the django horizon application to serve via apache/wsgi +# Set up the django horizon application to serve via apache/wsgi if is_service_enabled horizon; then @@ -900,7 +902,7 @@ if is_service_enabled horizon; then python manage.py syncdb cd $TOP_DIR - # create an empty directory that apache uses as docroot + # Create an empty directory that apache uses as docroot sudo mkdir -p $HORIZON_DIR/.blackhole if [[ "$os_PACKAGE" = "deb" ]]; then @@ -1007,8 +1009,10 @@ if is_service_enabled g-reg; then fi -# Quantum (for controller or agent nodes) + +# Quantum # ------- + if is_service_enabled quantum; then # Put config files in /etc/quantum for everyone to find if [[ ! -d /etc/quantum ]]; then @@ -1034,7 +1038,7 @@ if is_service_enabled quantum; then exit 1 fi - # if needed, move config file from $QUANTUM_DIR/etc/quantum to /etc/quantum + # If needed, move config file from $QUANTUM_DIR/etc/quantum to /etc/quantum mkdir -p /$Q_PLUGIN_CONF_PATH Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME if [[ -e $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE ]]; then @@ -1143,7 +1147,6 @@ if is_service_enabled m-svc; then fi - # Nova # ---- @@ -1279,7 +1282,7 @@ if is_service_enabled n-cpu; then QEMU_CONF=/etc/libvirt/qemu.conf if is_service_enabled quantum && [[ $Q_PLUGIN = "openvswitch" ]] && ! sudo grep -q '^cgroup_device_acl' $QEMU_CONF ; then - # add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces + # Add /dev/net/tun to cgroup_device_acls, needed for type=ethernet interfaces sudo chmod 666 $QEMU_CONF sudo cat <> /etc/libvirt/qemu.conf cgroup_device_acl = [ @@ -1363,7 +1366,10 @@ if is_service_enabled n-net; then sudo sysctl -w net.ipv4.ip_forward=1 fi + # Storage Service +# --------------- + if is_service_enabled swift; then # Install memcached for swift. install_package memcached @@ -1663,7 +1669,7 @@ function add_nova_opt { echo "$1" >> $NOVA_CONF_DIR/$NOVA_CONF } -# remove legacy nova.conf +# Remove legacy nova.conf rm -f $NOVA_DIR/bin/nova.conf # (re)create nova.conf @@ -1924,7 +1930,7 @@ if is_service_enabled key; then iniset $KEYSTONE_CONF_DIR/logging.conf logger_root level "DEBUG" iniset $KEYSTONE_CONF_DIR/logging.conf logger_root handlers "devel,production" - # Set up the keystone database + # Initialize keystone database $KEYSTONE_DIR/bin/keystone-manage db_sync # launch keystone and wait for it to answer before continuing @@ -1950,7 +1956,7 @@ if is_service_enabled key; then export OS_USERNAME=admin export OS_PASSWORD=$ADMIN_PASSWORD - # create an access key and secret key for nova ec2 register image + # Create an access key and secret key for nova ec2 register image if is_service_enabled swift && is_service_enabled nova; then NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1) NOVA_TENANT_ID=$(keystone tenant-list | grep " $SERVICE_TENANT_NAME " | get_field 1) @@ -1963,7 +1969,7 @@ if is_service_enabled key; then fi fi -# launch the nova-api and wait for it to answer before continuing +# Launch the nova-api and wait for it to answer before continuing if is_service_enabled n-api; then add_nova_opt "enabled_apis=$NOVA_ENABLED_APIS" screen_it n-api "cd $NOVA_DIR && $NOVA_DIR/bin/nova-api" @@ -1977,13 +1983,13 @@ fi # If we're using Quantum (i.e. q-svc is enabled), network creation has to # happen after we've started the Quantum service. if is_service_enabled mysql && is_service_enabled nova; then - # create a small network + # Create a small network $NOVA_DIR/bin/nova-manage network create private $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS - # create some floating ips + # Create some floating ips $NOVA_DIR/bin/nova-manage floating create $FLOATING_RANGE - # create a second pool + # Create a second pool $NOVA_DIR/bin/nova-manage floating create --ip_range=$TEST_FLOATING_RANGE --pool=$TEST_FLOATING_POOL fi @@ -2012,6 +2018,7 @@ screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONF is_service_enabled swift || \ screen_it n-obj "cd $NOVA_DIR && $NOVA_DIR/bin/nova-objectstore" + # Install Images # ============== diff --git a/unstack.sh b/unstack.sh index 879f842463..641d34e4cf 100755 --- a/unstack.sh +++ b/unstack.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# + +# **unstack.sh** + # Stops that which is started by ``stack.sh`` (mostly) # mysql and rabbit are left running as OpenStack code refreshes # do not require them to be restarted.