Merge "Fix duplicated rootwrap.d in lib/ironic"
diff --git a/exercises/aggregates.sh b/exercises/aggregates.sh
index 1b1ac06..d223301 100755
--- a/exercises/aggregates.sh
+++ b/exercises/aggregates.sh
@@ -43,6 +43,10 @@
# Test as the admin user
. $TOP_DIR/openrc admin admin
+# If nova api is not enabled we exit with exitcode 55 so that
+# the exercise is skipped
+is_service_enabled n-api || exit 55
+
# Cells does not support aggregates.
is_service_enabled n-cell && exit 55
diff --git a/exercises/bundle.sh b/exercises/bundle.sh
index b83678a..5470960 100755
--- a/exercises/bundle.sh
+++ b/exercises/bundle.sh
@@ -39,6 +39,10 @@
rm -f $TOP_DIR/cert.pem
rm -f $TOP_DIR/pk.pem
+# If nova api is not enabled we exit with exitcode 55 so that
+# the exercise is skipped
+is_service_enabled n-api || exit 55
+
# Get Certificates
nova x509-get-root-cert $TOP_DIR/cacert.pem
nova x509-create-cert $TOP_DIR/pk.pem $TOP_DIR/cert.pem
diff --git a/exercises/euca.sh b/exercises/euca.sh
index ed521e4..51b2644 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -41,6 +41,10 @@
# Import exercise configuration
source $TOP_DIR/exerciserc
+# If nova api is not enabled we exit with exitcode 55 so that
+# the exercise is skipped
+is_service_enabled n-api || exit 55
+
# Skip if the hypervisor is Docker
[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index 7055278..4ca90a5 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -38,6 +38,10 @@
# Import exercise configuration
source $TOP_DIR/exerciserc
+# If nova api is not enabled we exit with exitcode 55 so that
+# the exercise is skipped
+is_service_enabled n-api || exit 55
+
# Skip if the hypervisor is Docker
[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh
index 0c0d42f..1343f11 100755
--- a/exercises/neutron-adv-test.sh
+++ b/exercises/neutron-adv-test.sh
@@ -185,6 +185,14 @@
fi
}
+function neutron_debug_admin {
+ local os_username=$OS_USERNAME
+ local os_tenant_id=$OS_TENANT_ID
+ source $TOP_DIR/openrc admin admin
+ neutron-debug $@
+ source $TOP_DIR/openrc $os_username $os_tenant_id
+}
+
function add_tenant {
local TENANT=$1
local USER=$2
@@ -241,7 +249,7 @@
local NET_ID=$(neutron net-create --tenant-id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $TENANT_ID $NET_NAME $EXTRA"
neutron subnet-create --ip-version 4 --tenant-id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
- neutron-debug probe-create --device-owner compute $NET_ID
+ neutron_debug_admin probe-create --device-owner compute $NET_ID
source $TOP_DIR/openrc demo demo
}
diff --git a/exercises/sec_groups.sh b/exercises/sec_groups.sh
index eb32cc7..d71a1e0 100755
--- a/exercises/sec_groups.sh
+++ b/exercises/sec_groups.sh
@@ -33,6 +33,10 @@
# Import exercise configuration
source $TOP_DIR/exerciserc
+# If nova api is not enabled we exit with exitcode 55 so that
+# the exercise is skipped
+is_service_enabled n-api || exit 55
+
# Skip if the hypervisor is Docker
[[ "$VIRT_DRIVER" == "docker" ]] && exit 55
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index ea2d52d..07b6b60 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -28,16 +28,6 @@
export SERVICE_ENDPOINT=$SERVICE_ENDPOINT
SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}
-function get_id () {
- echo `"$@" | awk '/ id / { print $4 }'`
-}
-
-# Lookups
-SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
-ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
-MEMBER_ROLE=$(keystone role-list | awk "/ Member / { print \$2 }")
-
-
# Roles
# -----
@@ -45,53 +35,52 @@
# The admin role in swift allows a user to act as an admin for their tenant,
# but ResellerAdmin is needed for a user to act as any tenant. The name of this
# role is also configurable in swift-proxy.conf
-RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin)
+keystone role-create --name=ResellerAdmin
# Service role, so service users do not have to be admins
-SERVICE_ROLE=$(get_id keystone role-create --name=service)
+keystone role-create --name=service
# Services
# --------
if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "s-proxy" || "$ENABLED_SERVICES" =~ "swift" ]]; then
- NOVA_USER=$(keystone user-list | awk "/ nova / { print \$2 }")
# Nova needs ResellerAdmin role to download images when accessing
# swift through the s3 api.
keystone user-role-add \
- --tenant-id $SERVICE_TENANT \
- --user-id $NOVA_USER \
- --role-id $RESELLER_ROLE
+ --tenant $SERVICE_TENANT_NAME \
+ --user nova \
+ --role ResellerAdmin
fi
# Heat
if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
- HEAT_USER=$(get_id keystone user-create --name=heat \
+ keystone user-create --name=heat \
--pass="$SERVICE_PASSWORD" \
- --tenant_id $SERVICE_TENANT \
- --email=heat@example.com)
- keystone user-role-add --tenant-id $SERVICE_TENANT \
- --user-id $HEAT_USER \
- --role-id $SERVICE_ROLE
+ --tenant $SERVICE_TENANT_NAME \
+ --email=heat@example.com
+ keystone user-role-add --tenant $SERVICE_TENANT_NAME \
+ --user heat \
+ --role service
# heat_stack_user role is for users created by Heat
keystone role-create --name heat_stack_user
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- HEAT_CFN_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=heat-cfn \
--type=cloudformation \
- --description="Heat CloudFormation Service")
+ --description="Heat CloudFormation Service"
keystone endpoint-create \
--region RegionOne \
- --service_id $HEAT_CFN_SERVICE \
+ --service heat-cfn \
--publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1"
- HEAT_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=heat \
--type=orchestration \
- --description="Heat Service")
+ --description="Heat Service"
keystone endpoint-create \
--region RegionOne \
- --service_id $HEAT_SERVICE \
+ --service heat \
--publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s"
@@ -100,23 +89,23 @@
# Glance
if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
- GLANCE_USER=$(get_id keystone user-create \
+ keystone user-create \
--name=glance \
--pass="$SERVICE_PASSWORD" \
- --tenant_id $SERVICE_TENANT \
- --email=glance@example.com)
+ --tenant $SERVICE_TENANT_NAME \
+ --email=glance@example.com
keystone user-role-add \
- --tenant-id $SERVICE_TENANT \
- --user-id $GLANCE_USER \
- --role-id $ADMIN_ROLE
+ --tenant $SERVICE_TENANT_NAME \
+ --user glance \
+ --role admin
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- GLANCE_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=glance \
--type=image \
- --description="Glance Image Service")
+ --description="Glance Image Service"
keystone endpoint-create \
--region RegionOne \
- --service_id $GLANCE_SERVICE \
+ --service glance \
--publicurl "http://$SERVICE_HOST:9292" \
--adminurl "http://$SERVICE_HOST:9292" \
--internalurl "http://$SERVICE_HOST:9292"
@@ -125,25 +114,25 @@
# Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer" ]]; then
- CEILOMETER_USER=$(get_id keystone user-create --name=ceilometer \
+ keystone user-create --name=ceilometer \
--pass="$SERVICE_PASSWORD" \
- --tenant_id $SERVICE_TENANT \
- --email=ceilometer@example.com)
- keystone user-role-add --tenant-id $SERVICE_TENANT \
- --user-id $CEILOMETER_USER \
- --role-id $ADMIN_ROLE
+ --tenant $SERVICE_TENANT_NAME \
+ --email=ceilometer@example.com
+ keystone user-role-add --tenant $SERVICE_TENANT_NAME \
+ --user ceilometer \
+ --role admin
# Ceilometer needs ResellerAdmin role to access swift account stats.
- keystone user-role-add --tenant-id $SERVICE_TENANT \
- --user-id $CEILOMETER_USER \
- --role-id $RESELLER_ROLE
+ keystone user-role-add --tenant $SERVICE_TENANT_NAME \
+ --user ceilometer \
+ --role ResellerAdmin
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- CEILOMETER_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=ceilometer \
--type=metering \
- --description="Ceilometer Service")
+ --description="Ceilometer Service"
keystone endpoint-create \
--region RegionOne \
- --service_id $CEILOMETER_SERVICE \
+ --service ceilometer \
--publicurl "http://$SERVICE_HOST:8777" \
--adminurl "http://$SERVICE_HOST:8777" \
--internalurl "http://$SERVICE_HOST:8777"
@@ -153,13 +142,13 @@
# EC2
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- EC2_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=ec2 \
--type=ec2 \
- --description="EC2 Compatibility Layer")
+ --description="EC2 Compatibility Layer"
keystone endpoint-create \
--region RegionOne \
- --service_id $EC2_SERVICE \
+ --service ec2 \
--publicurl "http://$SERVICE_HOST:8773/services/Cloud" \
--adminurl "http://$SERVICE_HOST:8773/services/Admin" \
--internalurl "http://$SERVICE_HOST:8773/services/Cloud"
@@ -169,13 +158,13 @@
# S3
if [[ "$ENABLED_SERVICES" =~ "n-obj" || "$ENABLED_SERVICES" =~ "swift3" ]]; then
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- S3_SERVICE=$(get_id keystone service-create \
+ keystone service-create \
--name=s3 \
--type=s3 \
- --description="S3")
+ --description="S3"
keystone endpoint-create \
--region RegionOne \
- --service_id $S3_SERVICE \
+ --service s3 \
--publicurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \
--adminurl "http://$SERVICE_HOST:$S3_SERVICE_PORT" \
--internalurl "http://$SERVICE_HOST:$S3_SERVICE_PORT"
@@ -185,14 +174,14 @@
if [[ "$ENABLED_SERVICES" =~ "tempest" ]]; then
# Tempest has some tests that validate various authorization checks
# between two regular users in separate tenants
- ALT_DEMO_TENANT=$(get_id keystone tenant-create \
- --name=alt_demo)
- ALT_DEMO_USER=$(get_id keystone user-create \
+ keystone tenant-create \
+ --name=alt_demo
+ keystone user-create \
--name=alt_demo \
--pass="$ADMIN_PASSWORD" \
- --email=alt_demo@example.com)
+ --email=alt_demo@example.com
keystone user-role-add \
- --tenant-id $ALT_DEMO_TENANT \
- --user-id $ALT_DEMO_USER \
- --role-id $MEMBER_ROLE
+ --tenant alt_demo \
+ --user alt_demo \
+ --role Member
fi
diff --git a/lib/glance b/lib/glance
index 21c1fa5..55d5fb3 100644
--- a/lib/glance
+++ b/lib/glance
@@ -125,7 +125,7 @@
iniset $GLANCE_API_CONF DEFAULT swift_store_key $SERVICE_PASSWORD
iniset $GLANCE_API_CONF DEFAULT swift_store_create_container_on_put True
- iniset_multiline DEFAULT known_stores glance.store.filesystem.Store glance.store.http.Store glance.store.swift.Store
+ iniset $GLANCE_API_CONF DEFAULT known_stores "glance.store.filesystem.Store, glance.store.http.Store, glance.store.swift.Store"
fi
cp -p $GLANCE_DIR/etc/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
diff --git a/lib/keystone b/lib/keystone
index a7e5d66..ceefe6a 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -28,6 +28,7 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+source $TOP_DIR/lib/tls
# Defaults
# --------
diff --git a/lib/neutron b/lib/neutron
index 43f43f9..af92d54 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -1,5 +1,5 @@
# lib/neutron
-# functions - funstions specific to neutron
+# functions - functions specific to neutron
# Dependencies:
# ``functions`` file
@@ -505,8 +505,7 @@
[ ! -z "$pid" ] && sudo kill -9 $pid
fi
if is_service_enabled q-meta; then
- pid=$(ps aux | awk '/neutron-ns-metadata-proxy/ { print $2 }')
- [ ! -z "$pid" ] && sudo kill -9 $pid
+ sudo pkill -9 neutron-ns-metadata-proxy || :
fi
if is_service_enabled q-lbaas; then
@@ -958,6 +957,11 @@
_neutron_third_party_do stop
}
+# check_neutron_third_party_integration() - Check that third party integration is sane
+function check_neutron_third_party_integration() {
+ _neutron_third_party_do check
+}
+
# Restore xtrace
$XTRACE
diff --git a/lib/neutron_plugins/brocade b/lib/neutron_plugins/brocade
index f9275ca..8e18d04 100644
--- a/lib/neutron_plugins/brocade
+++ b/lib/neutron_plugins/brocade
@@ -38,7 +38,7 @@
}
function neutron_plugin_configure_plugin_agent() {
- AGENT_BINARY="$NEUTON_BIN_DIR/neutron-linuxbridge-agent"
+ AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
}
function neutron_plugin_setup_interface_driver() {
diff --git a/lib/neutron_thirdparty/README.md b/lib/neutron_thirdparty/README.md
index b289f58..2460e5c 100644
--- a/lib/neutron_thirdparty/README.md
+++ b/lib/neutron_thirdparty/README.md
@@ -34,3 +34,6 @@
* ``stop_<third_party>``:
stop running processes (non-screen)
+
+* ``check_<third_party>``:
+ verify that the integration between neutron server and third-party components is sane
diff --git a/lib/neutron_thirdparty/bigswitch_floodlight b/lib/neutron_thirdparty/bigswitch_floodlight
index ebde067..1fd4fd8 100644
--- a/lib/neutron_thirdparty/bigswitch_floodlight
+++ b/lib/neutron_thirdparty/bigswitch_floodlight
@@ -45,5 +45,9 @@
:
}
+function check_bigswitch_floodlight() {
+ :
+}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/neutron_thirdparty/midonet b/lib/neutron_thirdparty/midonet
index 7928bca..e672528 100644
--- a/lib/neutron_thirdparty/midonet
+++ b/lib/neutron_thirdparty/midonet
@@ -56,5 +56,9 @@
:
}
+function check_midonet() {
+ :
+}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/neutron_thirdparty/ryu b/lib/neutron_thirdparty/ryu
index 3b825a1..5edf273 100644
--- a/lib/neutron_thirdparty/ryu
+++ b/lib/neutron_thirdparty/ryu
@@ -75,5 +75,9 @@
:
}
+function check_ryu() {
+ :
+}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/neutron_thirdparty/trema b/lib/neutron_thirdparty/trema
index bdc2356..2b12564 100644
--- a/lib/neutron_thirdparty/trema
+++ b/lib/neutron_thirdparty/trema
@@ -109,5 +109,9 @@
sudo TREMA_TMP=$TREMA_TMP_DIR trema killall
}
+function check_trema() {
+ :
+}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/neutron_thirdparty/vmware_nsx b/lib/neutron_thirdparty/vmware_nsx
index 70d3482..7c62027 100644
--- a/lib/neutron_thirdparty/vmware_nsx
+++ b/lib/neutron_thirdparty/vmware_nsx
@@ -78,5 +78,9 @@
done
}
+function check_vmware_nsx() {
+ :
+}
+
# Restore xtrace
$MY_XTRACE
diff --git a/lib/nova b/lib/nova
index a508789..a4edb53 100644
--- a/lib/nova
+++ b/lib/nova
@@ -650,12 +650,11 @@
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
# Enable client side traces for libvirt
- export LIBVIRT_LOG_FILTERS="1:libvirt"
- export LIBVIRT_LOG_OUTPUTS="1:file:/var/log/libvirt/libvirtd-nova.log"
-
+ local log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 1:util"
+ local log_outputs="1:file:/var/log/libvirt/libvirtd.log"
# Enable server side traces for libvirtd
- echo "log_filters=\"1:libvirt 1:qemu\"" | sudo tee -a /etc/libvirt/libvirtd.conf
- echo "log_outputs=\"1:file:/var/log/libvirt/libvirtd.log\"" | sudo tee -a /etc/libvirt/libvirtd.conf
+ echo "log_filters=\"$log_filters\"" | sudo tee -a /etc/libvirt/libvirtd.conf
+ echo "log_outputs=\"$log_outputs\"" | sudo tee -a /etc/libvirt/libvirtd.conf
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
# Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group.
diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt
index ef40e7a..6f90f4a 100644
--- a/lib/nova_plugins/hypervisor-libvirt
+++ b/lib/nova_plugins/hypervisor-libvirt
@@ -93,9 +93,6 @@
fi
fi
- # Change the libvirtd log level to DEBUG.
- sudo sed -i s/"#log_level = 3"/"log_level = 1"/ /etc/libvirt/libvirtd.conf
-
# The user that nova runs as needs to be member of **libvirtd** group otherwise
# nova-compute will be unable to use libvirt.
if ! getent group $LIBVIRT_GROUP >/dev/null; then
diff --git a/lib/savanna b/lib/savanna
index bb4dfe6..c7d59f7 100644
--- a/lib/savanna
+++ b/lib/savanna
@@ -95,9 +95,7 @@
iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE DEFAULT os_admin_tenant_name $SERVICE_TENANT_NAME
iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE DEFAULT debug $SAVANNA_DEBUG
- recreate_database savanna utf8
- iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE database sql_connection `database_connection_url savanna`
- inicomment $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE database connection
+ iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE database connection `database_connection_url savanna`
if is_service_enabled neutron; then
iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE DEFAULT use_neutron true
@@ -105,6 +103,9 @@
fi
iniset $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE DEFAULT use_syslog $SYSLOG
+
+ recreate_database savanna utf8
+ $SAVANNA_BIN_DIR/savanna-db-manage --config-file $SAVANNA_CONF_DIR/$SAVANNA_CONF_FILE upgrade head
}
# install_savanna() - Collect source and prepare
diff --git a/stack.sh b/stack.sh
index 7da41a9..efdee64 100755
--- a/stack.sh
+++ b/stack.sh
@@ -860,11 +860,17 @@
# -------
# If enabled, systat has to start early to track OpenStack service startup.
-if is_service_enabled sysstat;then
+if is_service_enabled sysstat; then
+ # what we want to measure
+ # -u : cpu statitics
+ # -q : load
+ # -b : io load rates
+ # -w : process creation and context switch rates
+ SYSSTAT_OPTS="-u -q -b -w"
if [[ -n ${SCREEN_LOGDIR} ]]; then
- screen_it sysstat "cd ; sar -o $SCREEN_LOGDIR/$SYSSTAT_FILE $SYSSTAT_INTERVAL"
+ screen_it sysstat "cd $TOP_DIR; ./tools/sar_filter.py $SYSSTAT_OPTS -o $SCREEN_LOGDIR/$SYSSTAT_FILE $SYSSTAT_INTERVAL"
else
- screen_it sysstat "sar $SYSSTAT_INTERVAL"
+ screen_it sysstat "./tools/sar_filter.py $SYSSTAT_OPTS $SYSSTAT_INTERVAL"
fi
fi
@@ -1116,6 +1122,7 @@
if is_service_enabled q-svc; then
echo_summary "Starting Neutron"
start_neutron_service_and_check
+ check_neutron_third_party_integration
elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
NM_CONF=${NOVA_CONF}
if is_service_enabled n-cell; then
diff --git a/tools/sar_filter.py b/tools/sar_filter.py
new file mode 100755
index 0000000..ed8c196
--- /dev/null
+++ b/tools/sar_filter.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+#
+# Copyright 2014 Samsung Electronics Corp. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import re
+import subprocess
+import sys
+
+
+def is_data_line(line):
+ timestamp, data = parse_line(line)
+ return re.search('\d\.d', data)
+
+
+def parse_line(line):
+ m = re.search('(\d\d:\d\d:\d\d \w\w)(\s+((\S+)\s*)+)', line)
+ if m:
+ date = m.group(1)
+ data = m.group(2).rstrip()
+ return date, data
+ else:
+ return None, None
+
+
+process = subprocess.Popen(
+ "sar %s" % " ".join(sys.argv[1:]),
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+
+# Poll process for new output until finished
+
+start_time = ""
+header = ""
+data_line = ""
+printed_header = False
+current_ts = None
+while True:
+ nextline = process.stdout.readline()
+ if nextline == '' and process.poll() is not None:
+ break
+
+ date, data = parse_line(nextline)
+ # stop until we get to the first set of real lines
+ if not date:
+ continue
+
+ # now we eat the header lines, and only print out the header
+ # if we've never seen them before
+ if not start_time:
+ start_time = date
+ header += "%s %s" % (date, data)
+ elif date == start_time:
+ header += " %s" % data
+ elif not printed_header:
+ printed_header = True
+ print header
+
+ # now we know this is a data line, printing out if the timestamp
+ # has changed, and stacking up otherwise.
+ nextline = process.stdout.readline()
+ date, data = parse_line(nextline)
+ if date != current_ts:
+ current_ts = date
+ print data_line
+ data_line = "%s %s" % (date, data)
+ else:
+ data_line += " %s" % data
+
+ sys.stdout.flush()
diff --git a/unstack.sh b/unstack.sh
index 77dbe07..4445f1f 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -35,10 +35,12 @@
# Get project function libraries
source $TOP_DIR/lib/baremetal
+source $TOP_DIR/lib/ceilometer
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/keystone
source $TOP_DIR/lib/glance
source $TOP_DIR/lib/nova
+source $TOP_DIR/lib/heat
source $TOP_DIR/lib/horizon
source $TOP_DIR/lib/swift
source $TOP_DIR/lib/neutron