From 3bbd08214617f5a5e7b54253f9f8b786623546c8 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Thu, 24 Jul 2014 13:04:41 -0400 Subject: openstack initscript: add reset Some of the openstack data is associated with external resources (ie glance may have external files), we explicitly invoke the delete commands on those in additional to dropping and recreating the databases. Signed-off-by: Amy Fong --- .../recipes-devtools/python/python-nova/openrc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'meta-openstack/recipes-devtools/python/python-nova/openrc') diff --git a/meta-openstack/recipes-devtools/python/python-nova/openrc b/meta-openstack/recipes-devtools/python/python-nova/openrc index c28f355..35327ac 100644 --- a/meta-openstack/recipes-devtools/python/python-nova/openrc +++ b/meta-openstack/recipes-devtools/python/python-nova/openrc @@ -4,3 +4,24 @@ export OS_PASSWORD=%OS_PASSWORD% export OS_AUTH_URL="http://%CONTROLLER_HOST%:5000/v2.0/" export SERVICE_ENDPOINT="http://%CONTROLLER_HOST%:35357/v2.0" export SERVICE_TOKEN=%SERVICE_TOKEN% + +function get_field() { + while read data; do + if [ "$1" -lt 0 ]; then + field="(\$(NF$1))" + else + field="\$$(($1 + 1))" + fi + echo "$data" | awk -F'[ \t]*\\|[ \t]*' "{print $field}" + done +} + +function simple_delete() { + $1 | while read line; do + id=`echo $line | get_field $3` + if [ ! -z "$id" ] ; then + echo ">>> Delete $4: id=$id" + $2 $id > /dev/null 2>&1 + fi + done +} -- cgit v1.2.3-54-g00ecf