diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-07-24 13:04:41 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-25 15:45:25 -0400 |
| commit | 3bbd08214617f5a5e7b54253f9f8b786623546c8 (patch) | |
| tree | d782a074f3a013b302446817ef9d147ddee6bb60 /meta-openstack/recipes-devtools/python/python-nova/openrc | |
| parent | ce99c21125614dfa72428a9ef3ed563db8c99c93 (diff) | |
| download | meta-cloud-services-3bbd08214617f5a5e7b54253f9f8b786623546c8.tar.gz | |
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 <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/openrc')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/openrc | 21 |
1 files changed, 21 insertions, 0 deletions
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% | |||
| 4 | export OS_AUTH_URL="http://%CONTROLLER_HOST%:5000/v2.0/" | 4 | export OS_AUTH_URL="http://%CONTROLLER_HOST%:5000/v2.0/" |
| 5 | export SERVICE_ENDPOINT="http://%CONTROLLER_HOST%:35357/v2.0" | 5 | export SERVICE_ENDPOINT="http://%CONTROLLER_HOST%:35357/v2.0" |
| 6 | export SERVICE_TOKEN=%SERVICE_TOKEN% | 6 | export SERVICE_TOKEN=%SERVICE_TOKEN% |
| 7 | |||
| 8 | function get_field() { | ||
| 9 | while read data; do | ||
| 10 | if [ "$1" -lt 0 ]; then | ||
| 11 | field="(\$(NF$1))" | ||
| 12 | else | ||
| 13 | field="\$$(($1 + 1))" | ||
| 14 | fi | ||
| 15 | echo "$data" | awk -F'[ \t]*\\|[ \t]*' "{print $field}" | ||
| 16 | done | ||
| 17 | } | ||
| 18 | |||
| 19 | function simple_delete() { | ||
| 20 | $1 | while read line; do | ||
| 21 | id=`echo $line | get_field $3` | ||
| 22 | if [ ! -z "$id" ] ; then | ||
| 23 | echo ">>> Delete $4: id=$id" | ||
| 24 | $2 $id > /dev/null 2>&1 | ||
| 25 | fi | ||
| 26 | done | ||
| 27 | } | ||
