fuel-plugin-plumgrid/deployment_scripts/cleanup_os.sh
Javeria Khan 6ec9f25b1a Initial Commit - Fuel PLUMgrid Plugin
- Supports MOS 7.0 deployment

Change-Id: I3f6a17ba3b8720e22d3d1be29e45b13077879210
Signed-off-by: Javeria Khan <javeriak@plumgrid.com>
2016-02-13 01:12:57 -08:00

36 lines
1.3 KiB
Bash

#
# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
#
# 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.
#!/bin/bash
if [[ ! -f "/root/cleanup_os" ]];then
source /root/openrc
router_id=`neutron router-list | grep "network_id" | awk '{print $2}'`
neutron router-gateway-clear $router_id
subnet_id=`neutron router-port-list $router_id | grep "subnet_id" | awk '{print $8}' | awk -F '\"' '{print $2}'`
neutron router-interface-delete $router_id $subnet_id
neutron router-delete $router_id
neutron subnet-delete $subnet_id
neutron net-delete net04
neutron net-delete net04_ext
admin_id=`keystone tenant-list|grep admin|awk -F '|' '{ print $2 }'`
neutron security-group-delete --tenant-id $admin_id
neutron security-group-delete default
touch /root/cleanup_os
else
echo "Cleanup already preformed before, skipping."
fi