Merge "XenAPI: Fix new useage of trueorfalse"
diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh
index 1343f11..a9199e6 100755
--- a/exercises/neutron-adv-test.sh
+++ b/exercises/neutron-adv-test.sh
@@ -1,6 +1,11 @@
 #!/usr/bin/env bash
 #
-
+# Copyright 2012, Cisco Systems
+# Copyright 2012, VMware, Inc.
+# Copyright 2012, NTT MCL, Inc.
+#
+# Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com
+#
 # **neutron-adv-test.sh**
 
 # Perform integration testing of Nova and other components with Neutron.
@@ -406,14 +411,6 @@
 main() {
 
     echo Description
-    echo
-    echo Copyright 2012, Cisco Systems
-    echo Copyright 2012, VMware, Inc.
-    echo Copyright 2012, NTT MCL, Inc.
-    echo
-    echo Please direct any questions to dedutta@cisco.com, dwendlandt@vmware.com, nachi@nttmcl.com
-    echo
-
 
     if [ $# -eq 0 ] ; then
         # if no args are provided, run all tests
diff --git a/extras.d/50-ironic.sh b/extras.d/50-ironic.sh
new file mode 100644
index 0000000..f68a146
--- /dev/null
+++ b/extras.d/50-ironic.sh
@@ -0,0 +1,33 @@
+# ironic.sh - Devstack extras script to install ironic
+
+if is_service_enabled ir-api ir-cond; then
+    if [[ "$1" == "source" ]]; then
+        # Initial source
+        source $TOP_DIR/lib/ironic
+    elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+        echo_summary "Installing Ironic"
+        install_ironic
+        install_ironicclient
+        cleanup_ironic
+    elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+        echo_summary "Configuring Ironic"
+        configure_ironic
+
+        if is_service_enabled key; then
+            create_ironic_accounts
+        fi
+
+    elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+        # Initialize ironic
+        init_ironic
+
+        # Start the ironic API and ironic taskmgr components
+        echo_summary "Starting Ironic"
+        start_ironic
+    fi
+
+    if [[ "$1" == "unstack" ]]; then
+        stop_ironic
+        cleanup_ironic
+    fi
+fi
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index d477c42..9a34c76 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -2,12 +2,14 @@
 #
 # Initial data for Keystone using python-keystoneclient
 #
-# Tenant               User       Roles
+# Tenant               User         Roles
 # ------------------------------------------------------------------
-# service              glance     admin
-# service              heat       service        # if enabled
+# service              glance       service
+# service              glance-swift ResellerAdmin
+# service              heat         service        # if enabled
+# service              ceilometer   admin          # if enabled
 # Tempest Only:
-# alt_demo             alt_demo  Member
+# alt_demo             alt_demo     Member
 #
 # Variables set before calling this script:
 # SERVICE_TOKEN - aka admin_token in keystone.conf
@@ -96,7 +98,19 @@
     keystone user-role-add \
         --tenant $SERVICE_TENANT_NAME \
         --user glance \
-        --role admin
+        --role service
+    # required for swift access
+    if [[ "$ENABLED_SERVICES" =~ "s-proxy" ]]; then
+        keystone user-create \
+            --name=glance-swift \
+            --pass="$SERVICE_PASSWORD" \
+            --tenant $SERVICE_TENANT_NAME \
+            --email=glance-swift@example.com
+        keystone user-role-add \
+            --tenant $SERVICE_TENANT_NAME \
+            --user glance-swift \
+            --role ResellerAdmin
+    fi
     if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
         keystone service-create \
             --name=glance \
diff --git a/functions b/functions
index 73d65ce..281b676 100644
--- a/functions
+++ b/functions
@@ -1450,7 +1450,7 @@
         # vmdk disk type
         vmdk_create_type="$(head -25 $IMAGE | grep -a -F -m 1 'createType=' $IMAGE)"
         vmdk_create_type="${vmdk_create_type#*\"}"
-        vmdk_create_type="${vmdk_create_type%?}"
+        vmdk_create_type="${vmdk_create_type%\"*}"
 
         descriptor_data_pair_msg="Monolithic flat and VMFS disks "`
                                     `"should use a descriptor-data pair."
@@ -1495,6 +1495,8 @@
                 IMAGE_NAME="${flat_fname}"
             fi
             vmdk_disktype="preallocated"
+        elif [[ "$vmdk_create_type" = "streamOptimized" ]]; then
+            vmdk_disktype="streamOptimized"
         elif [[ -z "$vmdk_create_type" ]]; then
             # *-flat.vmdk provided: attempt to retrieve the descriptor (*.vmdk)
             # to retrieve appropriate metadata
@@ -1533,10 +1535,8 @@
                     vmdk_adapter_type="${vmdk_adapter_type%?}"
                 fi
             fi
-            #TODO(alegendre): handle streamOptimized once supported by the VMware driver.
             vmdk_disktype="preallocated"
         else
-            #TODO(alegendre): handle streamOptimized once supported by the VMware driver.
             vmdk_disktype="preallocated"
         fi
 
diff --git a/lib/baremetal b/lib/baremetal
index a0df85e..d8cd7e9 100644
--- a/lib/baremetal
+++ b/lib/baremetal
@@ -431,8 +431,7 @@
 
 function clear_baremetal_of_all_nodes() {
     list=$(nova baremetal-node-list | awk -F '| ' 'NR>3 {print $2}' )
-    for node in $list
-    do
+    for node in $list; do
         nova baremetal-node-delete $node
     done
 }
diff --git a/lib/ceilometer b/lib/ceilometer
index 30bf3ae..f9c7691 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -105,6 +105,7 @@
 # configure_ceilometerclient() - Set config files, create data dirs, etc
 function configure_ceilometerclient() {
     setup_develop $CEILOMETERCLIENT_DIR
+    sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
 }
 
 # configure_ceilometer() - Set config files, create data dirs, etc
@@ -137,7 +138,9 @@
     iniset $CEILOMETER_CONF DEFAULT os_password $SERVICE_PASSWORD
     iniset $CEILOMETER_CONF DEFAULT os_tenant_name $SERVICE_TENANT_NAME
 
-    iniset $CEILOMETER_CONF keystone_authtoken auth_protocol http
+    iniset $CEILOMETER_CONF keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
+    iniset $CEILOMETER_CONF keystone_authtoken auth_port $KEYSTONE_AUTH_PORT
+    iniset $CEILOMETER_CONF keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
     iniset $CEILOMETER_CONF keystone_authtoken admin_user ceilometer
     iniset $CEILOMETER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
     iniset $CEILOMETER_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
diff --git a/lib/glance b/lib/glance
index 2d41ea4..a5cb360 100644
--- a/lib/glance
+++ b/lib/glance
@@ -108,10 +108,8 @@
     iniset $GLANCE_API_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
     iniset $GLANCE_API_CONF keystone_authtoken admin_user glance
     iniset $GLANCE_API_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
-    if is_service_enabled qpid; then
-        iniset $GLANCE_API_CONF DEFAULT notifier_strategy qpid
-    elif [ -n "$RABBIT_HOST" ] &&  [ -n "$RABBIT_PASSWORD" ]; then
-        iniset $GLANCE_API_CONF DEFAULT notifier_strategy rabbit
+    if is_service_enabled qpid || [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; then
+        iniset $GLANCE_API_CONF DEFAULT notification_driver messaging
     fi
     iniset_rpc_backend glance $GLANCE_API_CONF DEFAULT
     iniset $GLANCE_API_CONF keystone_authtoken signing_dir $GLANCE_AUTH_CACHE_DIR/api
@@ -124,7 +122,7 @@
     if is_service_enabled s-proxy; then
         iniset $GLANCE_API_CONF DEFAULT default_store swift
         iniset $GLANCE_API_CONF DEFAULT swift_store_auth_address $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/
-        iniset $GLANCE_API_CONF DEFAULT swift_store_user $SERVICE_TENANT_NAME:glance
+        iniset $GLANCE_API_CONF DEFAULT swift_store_user $SERVICE_TENANT_NAME:glance-swift
         iniset $GLANCE_API_CONF DEFAULT swift_store_key $SERVICE_PASSWORD
         iniset $GLANCE_API_CONF DEFAULT swift_store_create_container_on_put True
 
diff --git a/lib/heat b/lib/heat
index 467619f..9f5dd8b 100644
--- a/lib/heat
+++ b/lib/heat
@@ -157,6 +157,7 @@
 function install_heatclient() {
     git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
     setup_develop $HEATCLIENT_DIR
+    sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
 }
 
 # install_heat() - Collect source and prepare
@@ -185,8 +186,7 @@
     local elements=$2
     local arch=$3
     local output=$TOP_DIR/files/$4
-    if [[ -f "$output.qcow2" ]];
-    then
+    if [[ -f "$output.qcow2" ]]; then
         echo "Image file already exists: $output_file"
     else
         ELEMENTS_PATH=$elements_path disk-image-create \
diff --git a/lib/horizon b/lib/horizon
index c64d850..2f5795d 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -81,9 +81,6 @@
 
 # init_horizon() - Initialize databases, etc.
 function init_horizon() {
-    # Remove stale session database.
-    rm -f $HORIZON_DIR/openstack_dashboard/local/dashboard_openstack.sqlite3
-
     # ``local_settings.py`` is used to override horizon default settings.
     local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
     cp $HORIZON_SETTINGS $local_settings
@@ -106,12 +103,6 @@
         _horizon_config_set $local_settings OPENSTACK_NEUTRON_NETWORK enable_vpn True
     fi
 
-    # Initialize the horizon database (it stores sessions and notices shown to
-    # users).  The user system is external (keystone).
-    cd $HORIZON_DIR
-    python manage.py syncdb --noinput
-    cd $TOP_DIR
-
     # Create an empty directory that apache uses as docroot
     sudo mkdir -p $HORIZON_DIR/.blackhole
 
diff --git a/lib/ironic b/lib/ironic
index b8838f5..0b9df57 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -49,6 +49,13 @@
 # Functions
 # ---------
 
+# Test if any Ironic services are enabled
+# is_ironic_enabled
+function is_ironic_enabled {
+    [[ ,${ENABLED_SERVICES} =~ ,"ir-" ]] && return 0
+    return 1
+}
+
 # install_ironic() - Collect source and prepare
 function install_ironic() {
     git_clone $IRONIC_REPO $IRONIC_DIR $IRONIC_BRANCH
diff --git a/lib/neutron_plugins/bigswitch_floodlight b/lib/neutron_plugins/bigswitch_floodlight
index 93ec497..1e4aa00 100644
--- a/lib/neutron_plugins/bigswitch_floodlight
+++ b/lib/neutron_plugins/bigswitch_floodlight
@@ -44,16 +44,14 @@
 function neutron_plugin_configure_service() {
     iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
     iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
-    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
-    then
+    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
         iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
     fi
 }
 
 function neutron_plugin_setup_interface_driver() {
     local conf_file=$1
-    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]
-    then
+    if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
         iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.IVSInterfaceDriver
     else
         iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
diff --git a/lib/neutron_plugins/embrane b/lib/neutron_plugins/embrane
new file mode 100644
index 0000000..4206a20
--- /dev/null
+++ b/lib/neutron_plugins/embrane
@@ -0,0 +1,40 @@
+# Neutron Embrane plugin
+# ---------------------------
+
+# Save trace setting
+MY_XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+source $TOP_DIR/lib/neutron_plugins/openvswitch
+
+save_function() {
+    local ORIG_FUNC=$(declare -f $1)
+    local NEW_FUNC="$2${ORIG_FUNC#$1}"
+    eval "$NEW_FUNC"
+}
+
+save_function neutron_plugin_configure_service _neutron_plugin_configure_service
+
+function neutron_plugin_configure_common() {
+    Q_PLUGIN_CONF_PATH=etc/neutron/plugins/embrane
+    Q_PLUGIN_CONF_FILENAME=heleos_conf.ini
+    Q_DB_NAME="ovs_neutron"
+    Q_PLUGIN_CLASS="neutron.plugins.embrane.plugins.embrane_ovs_plugin.EmbraneOvsPlugin"
+}
+
+function neutron_plugin_configure_service() {
+    _neutron_plugin_configure_service
+    iniset /$Q_PLUGIN_CONF_FILE heleos esm_mgmt $HELEOS_ESM_MGMT
+    iniset /$Q_PLUGIN_CONF_FILE heleos admin_username $HELEOS_ADMIN_USERNAME
+    iniset /$Q_PLUGIN_CONF_FILE heleos admin_password $HELEOS_ADMIN_PASSWORD
+    iniset /$Q_PLUGIN_CONF_FILE heleos router_image $HELEOS_ROUTER_IMAGE
+    iniset /$Q_PLUGIN_CONF_FILE heleos mgmt_id $HELEOS_MGMT_ID
+    iniset /$Q_PLUGIN_CONF_FILE heleos inband_id $HELEOS_INBAND_ID
+    iniset /$Q_PLUGIN_CONF_FILE heleos oob_id $HELEOS_OOB_ID
+    iniset /$Q_PLUGIN_CONF_FILE heleos dummy_utif_id $HELEOS_DUMMY_UTIF_ID
+    iniset /$Q_PLUGIN_CONF_FILE heleos resource_pool_id $HELEOS_RESOURCE_POOL_ID
+    iniset /$Q_PLUGIN_CONF_FILE heleos async_requests $HELEOS_ASYNC_REQUESTS
+}
+
+# Restore xtrace
+$MY_XTRACE
\ No newline at end of file
diff --git a/lib/neutron_plugins/nec b/lib/neutron_plugins/nec
index d8d8b7c..1cb2fef 100644
--- a/lib/neutron_plugins/nec
+++ b/lib/neutron_plugins/nec
@@ -106,8 +106,7 @@
     local id=0
     GRE_LOCAL_IP=${GRE_LOCAL_IP:-$HOST_IP}
     if [ -n "$GRE_REMOTE_IPS" ]; then
-        for ip in ${GRE_REMOTE_IPS//:/ }
-        do
+        for ip in ${GRE_REMOTE_IPS//:/ }; do
             if [[ "$ip" == "$GRE_LOCAL_IP" ]]; then
                 continue
             fi
diff --git a/lib/neutron_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight
index 1fd4fd8..24c1044 100644
--- a/lib/neutron_thirdparty/bigswitch_floodlight
+++ b/lib/neutron_thirdparty/bigswitch_floodlight
@@ -24,8 +24,7 @@
     sudo ovs-vsctl --no-wait br-set-external-id ${OVS_BRIDGE} bridge-id ${OVS_BRIDGE}
 
     ctrls=
-    for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`
-    do
+    for ctrl in `echo ${BS_FL_CONTROLLERS_PORT} | tr ',' ' '`; do
         ctrl=${ctrl%:*}
         ctrls="${ctrls} tcp:${ctrl}:${BS_FL_OF_PORT}"
     done
diff --git a/lib/nova b/lib/nova
index d5f7514..dcf1617 100644
--- a/lib/nova
+++ b/lib/nova
@@ -240,11 +240,6 @@
         sudo sysctl -w net.ipv4.ip_forward=1
 
         if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
-            # When libguestfs is available for file injection, enable using
-            # libguestfs to inspect the image and figure out the proper
-            # partition to inject into.
-            iniset $NOVA_CONF libvirt inject_partition '-1'
-
             # Check for kvm (hardware based virtualization).  If unable to initialize
             # kvm, we drop back to the slower emulation mode (qemu).  Note: many systems
             # come with hardware virtualization disabled in BIOS.
@@ -394,6 +389,10 @@
     fi
 
     if is_service_enabled n-api; then
+        if is_service_enabled n-api-meta; then
+            # If running n-api-meta as a separate service
+            NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/,metadata//")
+        fi
         iniset $NOVA_CONF DEFAULT enabled_apis "$NOVA_ENABLED_APIS"
         if is_service_enabled tls-proxy; then
             # Set the service port for a proxy to take the original
@@ -447,7 +446,7 @@
         iniset $NOVA_CONF DEFAULT instance_usage_audit "True"
         iniset $NOVA_CONF DEFAULT instance_usage_audit_period "hour"
         iniset $NOVA_CONF DEFAULT notify_on_state_change "vm_and_task_state"
-        iniset $NOVA_CONF DEFAULT notification_driver "nova.openstack.common.notifier.rpc_notifier"
+        iniset $NOVA_CONF DEFAULT notification_driver "messaging"
     fi
 
     # Provide some transition from ``EXTRA_FLAGS`` to ``EXTRA_OPTS``
@@ -500,6 +499,12 @@
     iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
     iniset_rpc_backend nova $NOVA_CONF DEFAULT
     iniset $NOVA_CONF DEFAULT glance_api_servers "$GLANCE_HOSTPORT"
+
+    if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
+        # File injection is being disabled by default in the near future -
+        # disable it here for now to avoid surprises later.
+        iniset $NOVA_CONF libvirt inject_partition '-2'
+    fi
 }
 
 function init_nova_cells() {
diff --git a/lib/nova_plugins/hypervisor-docker b/lib/nova_plugins/hypervisor-docker
index 0153953..bb934b8 100644
--- a/lib/nova_plugins/hypervisor-docker
+++ b/lib/nova_plugins/hypervisor-docker
@@ -31,10 +31,10 @@
 DOCKER_PID_FILE=/var/run/docker.pid
 DOCKER_REGISTRY_PORT=${DOCKER_REGISTRY_PORT:-5042}
 
-DOCKER_IMAGE=${DOCKER_IMAGE:-http://get.docker.io/images/openstack/docker-ut.tar.gz}
-DOCKER_IMAGE_NAME=docker-busybox
-DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-http://get.docker.io/images/openstack/docker-registry.tar.gz}
-DOCKER_REGISTRY_IMAGE_NAME=docker-registry
+DOCKER_IMAGE=${DOCKER_IMAGE:-busybox:latest}
+DOCKER_IMAGE_NAME=busybox
+DOCKER_REGISTRY_IMAGE=${DOCKER_REGISTRY_IMAGE:-registry:latest}
+DOCKER_REGISTRY_IMAGE_NAME=registry
 DOCKER_REPOSITORY_NAME=${SERVICE_HOST}:${DOCKER_REGISTRY_PORT}/${DOCKER_IMAGE_NAME}
 
 DOCKER_APT_REPO=${DOCKER_APT_REPO:-https://get.docker.io/ubuntu}
diff --git a/lib/swift b/lib/swift
index 54d6f1c..4412608 100644
--- a/lib/swift
+++ b/lib/swift
@@ -341,7 +341,7 @@
 # NOTE(chmou): s3token middleware is not updated yet to use only
 # username and password.
 [filter:s3token]
-paste.filter_factory = keystone.middleware.s3_token:filter_factory
+paste.filter_factory = keystoneclient.middleware.s3_token:filter_factory
 auth_port = ${KEYSTONE_AUTH_PORT}
 auth_host = ${KEYSTONE_AUTH_HOST}
 auth_protocol = ${KEYSTONE_AUTH_PROTOCOL}
@@ -657,10 +657,8 @@
     if type -p swift-init >/dev/null; then
         swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
     fi
-    for type in proxy object container account; do
-        # Dump all of the servers
-        pkill -f swift-
-    done
+    # Dump all of the servers
+    pkill -f swift-
 }
 
 # Restore xtrace
diff --git a/lib/tempest b/lib/tempest
index 06183b1..76da170 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -251,6 +251,7 @@
 
     # Identity
     iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
+    iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v3/"
     iniset $TEMPEST_CONFIG identity password "$password"
     iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME
     iniset $TEMPEST_CONFIG identity alt_password "$password"
@@ -266,11 +267,6 @@
 
     # Compute
     iniset $TEMPEST_CONFIG compute change_password_available False
-    # Note(nati) current tempest don't create network for each tenant
-    # so reuse same tenant for now
-    if is_service_enabled neutron; then
-        TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
-    fi
     iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
     iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
     iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
@@ -323,7 +319,7 @@
     fi
     CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
     if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
-        iniset $TEMPEST_CONFIG volume multi_backend_enabled "True"
+        iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
         iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI"
         iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2"
     fi
diff --git a/lib/trove b/lib/trove
index 2000446..bb45491 100644
--- a/lib/trove
+++ b/lib/trove
@@ -148,8 +148,6 @@
     iniset $TROVE_CONF_DIR/trove.conf DEFAULT add_addresses True
 
     iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
-    iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT sql_connection `database_connection_url trove`
-    iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT control_exchange trove
     sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
 
     setup_trove_logging $TROVE_CONF_DIR/trove.conf
diff --git a/stack.sh b/stack.sh
index 45d47c8..303541d 100755
--- a/stack.sh
+++ b/stack.sh
@@ -336,7 +336,6 @@
 source $TOP_DIR/lib/neutron
 source $TOP_DIR/lib/baremetal
 source $TOP_DIR/lib/ldap
-source $TOP_DIR/lib/ironic
 
 # Extras Source
 # --------------
@@ -363,7 +362,11 @@
     var=$1; msg=$2
     pw=${!var}
 
-    localrc=$TOP_DIR/localrc
+    if [[ -f $RC_DIR/localrc ]]; then
+        localrc=$TOP_DIR/localrc
+    else
+        localrc=$TOP_DIR/.localrc.auto
+    fi
 
     # If the password is not defined yet, proceed to prompt user for a password.
     if [ ! $pw ]; then
@@ -746,11 +749,6 @@
     # don't be naive and add to existing line!
 fi
 
-if is_service_enabled ir-api ir-cond; then
-    install_ironic
-    install_ironicclient
-    configure_ironic
-fi
 
 # Extras Install
 # --------------
@@ -966,15 +964,6 @@
 fi
 
 
-# Ironic
-# ------
-
-if is_service_enabled ir-api ir-cond; then
-    echo_summary "Configuring Ironic"
-    init_ironic
-fi
-
-
 # Neutron
 # -------
 
@@ -1101,12 +1090,6 @@
     start_glance
 fi
 
-# Launch the Ironic services
-if is_service_enabled ir-api ir-cond; then
-    echo_summary "Starting Ironic"
-    start_ironic
-fi
-
 # Create an access key and secret key for nova ec2 register image
 if is_service_enabled key && is_service_enabled swift3 && is_service_enabled nova; then
     NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
@@ -1124,8 +1107,8 @@
 # Create a randomized default value for the keymgr's fixed_key
 if is_service_enabled nova; then
     FIXED_KEY=""
-    for i in $(seq 1 64);
-        do FIXED_KEY+=$(echo "obase=16; $(($RANDOM % 16))" | bc);
+    for i in $(seq 1 64); do
+        FIXED_KEY+=$(echo "obase=16; $(($RANDOM % 16))" | bc);
     done;
     iniset $NOVA_CONF keymgr fixed_key "$FIXED_KEY"
 fi
diff --git a/stackrc b/stackrc
index e89d25e..7eed60c 100644
--- a/stackrc
+++ b/stackrc
@@ -171,7 +171,7 @@
 # storage service
 SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
 SWIFT_BRANCH=${SWIFT_BRANCH:-master}
-SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/fujita/swift3.git}
+SWIFT3_REPO=${SWIFT3_REPO:-http://github.com/fujita/swift3.git}
 SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
 
 # python swift client library
diff --git a/tests/functions.sh b/tests/functions.sh
index 95dafe1..06a4134 100755
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -49,8 +49,7 @@
 
     ENABLED_SERVICES="$start"
     enable_service $add
-    if [ "$ENABLED_SERVICES" = "$finish" ]
-    then
+    if [ "$ENABLED_SERVICES" = "$finish" ]; then
         echo "OK: $start + $add -> $ENABLED_SERVICES"
     else
         echo "changing $start to $finish with $add failed: $ENABLED_SERVICES"
@@ -76,8 +75,7 @@
 
     ENABLED_SERVICES="$start"
     disable_service "$del"
-    if [ "$ENABLED_SERVICES" = "$finish" ]
-    then
+    if [ "$ENABLED_SERVICES" = "$finish" ]; then
         echo "OK: $start - $del -> $ENABLED_SERVICES"
     else
         echo "changing $start to $finish with $del failed: $ENABLED_SERVICES"
@@ -102,8 +100,7 @@
 ENABLED_SERVICES=a,b,c
 disable_all_services
 
-if [[ -z "$ENABLED_SERVICES" ]]
-then
+if [[ -z "$ENABLED_SERVICES" ]]; then
     echo "OK"
 else
     echo "disabling all services FAILED: $ENABLED_SERVICES"
@@ -118,8 +115,7 @@
 
     ENABLED_SERVICES="$start"
     disable_negated_services
-    if [ "$ENABLED_SERVICES" = "$finish" ]
-    then
+    if [ "$ENABLED_SERVICES" = "$finish" ]; then
         echo "OK: $start + $add -> $ENABLED_SERVICES"
     else
         echo "changing $start to $finish failed: $ENABLED_SERVICES"
diff --git a/tools/bash8.py b/tools/bash8.py
index edf7da4..7552e0d 100755
--- a/tools/bash8.py
+++ b/tools/bash8.py
@@ -21,17 +21,37 @@
 # Currently Supported checks
 #
 # Errors
+# Basic white space errors, for consistent indenting
 # - E001: check that lines do not end with trailing whitespace
 # - E002: ensure that indents are only spaces, and not hard tabs
 # - E003: ensure all indents are a multiple of 4 spaces
+#
+# Structure errors
+#
+# A set of rules that help keep things consistent in control blocks.
+# These are ignored on long lines that have a continuation, because
+# unrolling that is kind of "interesting"
+#
+# - E010: *do* not on the same line as *for*
+# - E011: *then* not on the same line as *if*
 
 import argparse
 import fileinput
 import re
 import sys
 
-
 ERRORS = 0
+IGNORE = None
+
+
+def register_ignores(ignores):
+    global IGNORE
+    if ignores:
+        IGNORE = '^(' + '|'.join(ignores.split(',')) + ')'
+
+
+def should_ignore(error):
+    return IGNORE and re.search(IGNORE, error)
 
 
 def print_error(error, line):
@@ -41,6 +61,27 @@
     print(" - %s: L%s" % (fileinput.filename(), fileinput.filelineno()))
 
 
+def not_continuation(line):
+    return not re.search('\\\\$', line)
+
+
+def check_for_do(line):
+    if not_continuation(line):
+        match = re.match('^\s*(for|while|until)\s', line)
+        if match:
+            operator = match.group(1).strip()
+            if not re.search(';\s*do(\b|$)', line):
+                print_error('E010: Do not on same line as %s' % operator,
+                            line)
+
+
+def check_if_then(line):
+    if not_continuation(line):
+        if re.search('^\s*if \[', line):
+            if not re.search(';\s*then(\b|$)', line):
+                print_error('E011: Then non on same line as if', line)
+
+
 def check_no_trailing_whitespace(line):
     if re.search('[ \t]+$', line):
         print_error('E001: Trailing Whitespace', line)
@@ -90,6 +131,8 @@
 
         check_no_trailing_whitespace(logical_line)
         check_indents(logical_line)
+        check_for_do(logical_line)
+        check_if_then(logical_line)
 
 
 def get_options():
@@ -97,11 +140,13 @@
         description='A bash script style checker')
     parser.add_argument('files', metavar='file', nargs='+',
                         help='files to scan for errors')
+    parser.add_argument('-i', '--ignore', help='Rules to ignore')
     return parser.parse_args()
 
 
 def main():
     opts = get_options()
+    register_ignores(opts.ignore)
     check_files(opts.files)
 
     if ERRORS > 0:
diff --git a/tools/create_userrc.sh b/tools/create_userrc.sh
index 5f4c486..e2d855c 100755
--- a/tools/create_userrc.sh
+++ b/tools/create_userrc.sh
@@ -71,8 +71,7 @@
 ROLE=Member
 USER_NAME=""
 USER_PASS=""
-while [ $# -gt 0 ]
-do
+while [ $# -gt 0 ]; do
     case "$1" in
     -h|--help) display_help; exit 0 ;;
     --os-username) export OS_USERNAME=$2; shift ;;
diff --git a/tools/docker/install_docker.sh b/tools/docker/install_docker.sh
index 375cfe9..4fa2386 100755
--- a/tools/docker/install_docker.sh
+++ b/tools/docker/install_docker.sh
@@ -55,21 +55,10 @@
     die $LINENO "docker did not start"
 fi
 
+# Get guest container image
+docker pull $DOCKER_IMAGE
+docker tag $DOCKER_IMAGE $DOCKER_IMAGE_NAME
 
-# Get Docker image
-if [[ ! -r $FILES/docker-ut.tar.gz ]]; then
-    (cd $FILES; curl -OR $DOCKER_IMAGE)
-fi
-if [[ ! -r $FILES/docker-ut.tar.gz ]]; then
-    die $LINENO "Docker image unavailable"
-fi
-docker import - $DOCKER_IMAGE_NAME <$FILES/docker-ut.tar.gz
-
-# Get Docker registry image
-if [[ ! -r $FILES/docker-registry.tar.gz ]]; then
-    (cd $FILES; curl -OR $DOCKER_REGISTRY_IMAGE)
-fi
-if [[ ! -r $FILES/docker-registry.tar.gz ]]; then
-    die $LINENO "Docker registry image unavailable"
-fi
-docker import - $DOCKER_REGISTRY_IMAGE_NAME <$FILES/docker-registry.tar.gz
+# Get docker-registry image
+docker pull $REGISTRY_IMAGE
+docker tag $REGISTRY_IMAGE $REGISTRY_IMAGE_NAME
diff --git a/tools/xen/install_os_domU.sh b/tools/xen/install_os_domU.sh
index 41b184c..d0d81a2 100755
--- a/tools/xen/install_os_domU.sh
+++ b/tools/xen/install_os_domU.sh
@@ -191,11 +191,9 @@
     domid=$(xe vm-list name-label="$GUEST_NAME" params=dom-id minimal=true)
     port=$(xenstore-read /local/domain/$domid/console/vnc-port)
     echo "vncviewer -via root@$mgmt_ip localhost:${port:2}"
-    while true
-    do
+    while true; do
         state=$(xe_min vm-list name-label="$GUEST_NAME" power-state=halted)
-        if [ -n "$state" ]
-        then
+        if [ -n "$state" ]; then
             break
         else
             echo -n "."
diff --git a/tools/xen/scripts/install-os-vpx.sh b/tools/xen/scripts/install-os-vpx.sh
index 7b0d891..b9b65fd 100755
--- a/tools/xen/scripts/install-os-vpx.sh
+++ b/tools/xen/scripts/install-os-vpx.sh
@@ -42,8 +42,7 @@
 
 get_params()
 {
-    while getopts "hbn:r:l:t:" OPTION;
-    do
+    while getopts "hbn:r:l:t:" OPTION; do
         case $OPTION in
             h) usage
                 exit 1
@@ -63,8 +62,7 @@
                 ;;
         esac
     done
-    if [[ -z $BRIDGE ]]
-    then
+    if [[ -z $BRIDGE ]]; then
         BRIDGE=xenbr0
     fi
 
@@ -91,8 +89,7 @@
 find_network()
 {
     result=$(xe_min network-list bridge="$1")
-    if [ "$result" = "" ]
-    then
+    if [ "$result" = "" ]; then
         result=$(xe_min network-list name-label="$1")
     fi
     echo "$result"
@@ -121,8 +118,7 @@
 {
     local v="$1"
     IFS=,
-    for vif in $(xe_min vif-list vm-uuid="$v")
-    do
+    for vif in $(xe_min vif-list vm-uuid="$v"); do
         xe vif-destroy uuid="$vif"
     done
     unset IFS
diff --git a/tools/xen/scripts/on_exit.sh b/tools/xen/scripts/on_exit.sh
index a4db39c..2441e3d 100755
--- a/tools/xen/scripts/on_exit.sh
+++ b/tools/xen/scripts/on_exit.sh
@@ -7,8 +7,7 @@
 
 on_exit()
 {
-    for i in $(seq $((${#on_exit_hooks[*]} - 1)) -1 0)
-    do
+    for i in $(seq $((${#on_exit_hooks[*]} - 1)) -1 0); do
         eval "${on_exit_hooks[$i]}"
     done
 }
@@ -17,8 +16,7 @@
 {
     local n=${#on_exit_hooks[*]}
     on_exit_hooks[$n]="$*"
-    if [[ $n -eq 0 ]]
-    then
+    if [[ $n -eq 0 ]]; then
         trap on_exit EXIT
     fi
 }
diff --git a/tools/xen/test_functions.sh b/tools/xen/test_functions.sh
index 373d996..838f86a 100755
--- a/tools/xen/test_functions.sh
+++ b/tools/xen/test_functions.sh
@@ -227,16 +227,14 @@
 }
 
 [ "$1" = "run_tests" ] && {
-    for testname in $($0)
-    do
+    for testname in $($0); do
         echo "$testname"
         before_each_test
         (
             set -eux
             $testname
         )
-        if [ "$?" != "0" ]
-        then
+        if [ "$?" != "0" ]; then
             echo "FAIL"
             exit 1
         else
diff --git a/tools/xen/xenrc b/tools/xen/xenrc
index 96f3734..278bb9b 100644
--- a/tools/xen/xenrc
+++ b/tools/xen/xenrc
@@ -35,7 +35,7 @@
 GUEST_PASSWORD=${GUEST_PASSWORD:-secrete}
 
 # Extracted variables for OpenStack VM network device numbers.
-# Make sure, they form a continous sequence starting from 0
+# Make sure they form a continuous sequence starting from 0
 MGT_DEV_NR=0
 VM_DEV_NR=1
 PUB_DEV_NR=2
diff --git a/unstack.sh b/unstack.sh
index 92d0642..ea9c27d 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -55,7 +55,6 @@
 source $TOP_DIR/lib/neutron
 source $TOP_DIR/lib/baremetal
 source $TOP_DIR/lib/ldap
-source $TOP_DIR/lib/ironic
 
 # Extras Source
 # --------------
@@ -118,12 +117,6 @@
     cleanup_swift
 fi
 
-# Ironic runs daemons
-if is_service_enabled ir-api ir-cond; then
-    stop_ironic
-    cleanup_ironic
-fi
-
 # Apache has the WSGI processes
 if is_service_enabled horizon; then
     stop_horizon