diff options
author | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2017-08-16 15:19:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-16 15:19:57 +0000 |
commit | 824ebdacf05ffba94a280c2db655e034ed567106 (patch) | |
tree | d729b016e573ed2c35d064b07e6c6e10d2d04d7e /prototypes/bifrost/scripts/destroy-env.sh | |
parent | 6b7293d1c19c084071bfd9d4af16a7b7fdc15930 (diff) | |
parent | 878fdf4f0b0c9cbe416adacf001844c0aa6d3b0f (diff) |
Merge "xci: Remove prototypes directory due to migration to releng-xci repo"
Diffstat (limited to 'prototypes/bifrost/scripts/destroy-env.sh')
-rwxr-xr-x | prototypes/bifrost/scripts/destroy-env.sh | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh deleted file mode 100755 index c75e814b7..000000000 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2016 RedHat and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -# We need to execute everything as root -if [[ $(whoami) != "root" ]]; then - echo "Error: This script must be run as root!" - exit 1 -fi - -# Start fresh -rm -rf /opt/stack -# HOME is normally set by sudo -H -rm -rf ${HOME}/.config/openstack - -# Delete all libvirt VMs and hosts from vbmc (look for a port number) -for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do - virsh destroy $vm || true - virsh undefine $vm || true - vbmc delete $vm -done - -service ironic-conductor stop || true - -echo "removing inventory files created by previous builds" -rm -rf /tmp/baremetal.* - -echo "removing ironic database" -if $(which mysql &> /dev/null); then - mysql -u root ironic --execute "drop database ironic;" -fi -echo "removing leases" -[[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases -echo "removing logs" -rm -rf /var/log/libvirt/baremetal_logs/* - -# clean up dib images only if requested explicitly -CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false} - -if [ $CLEAN_DIB_IMAGES = "true" ]; then - rm -rf /httpboot /tftpboot - mkdir /httpboot /tftpboot - chmod -R 755 /httpboot /tftpboot -fi - -# remove VM disk images -rm -rf /var/lib/libvirt/images/*.qcow2 - -echo "restarting services" -service dnsmasq restart || true -service libvirtd restart -service ironic-api restart || true -service ironic-conductor start || true -service ironic-inspector restart || true |