config/controllerconfig/controllerconfig/scripts/finish_install_clone.sh
SidneyAn 47ac546217 Fixing linters errors E010, E011, E020, E041,E043, E003, E001,E042
Listed below are the errors which were fixed as well as the actions
    taken to fix them:
    E010: do not on the same line as for
    --> let do and for in the same line
    E011: then not on the same line as if or elif
    --> let then and if or elif in the same line
    E020: Function declaration not in format ^function name {$
    --> fix the format to suit ^function name {$
    E041: Usage of $[ for arithmetic is deprecated for $((
    --> fix from $[ to $((
    E043: arithmetic compound has inconsistent return semantics
    --> do not use +=, ++, -=, --; use value=value+?  instead.
    E001: check that lines do not end with trailing whitespace
    --> delete trailing whitespace
    E003: ensure all indents are a multiple of 4 spaces
    --> add/delete spaces
    E042: local declaration hides errors
    --> let declaration and assignment in two lines.

    Listed below are test cases done which run one controller
    and one compute in KVMs
    Test-Install      ----  success

Related: https://review.openstack.org/#/c/600663/
         https://review.openstack.org/#/c/601221/

Story: 2003360
Task: 26213

Change-Id: I3ece37db3a326ea58bd344f43beefcbbbd4f0ad4
Signed-off-by: SidneyAn <ran1.an@intel.com>
2018-09-11 21:47:40 +08:00

43 lines
1.0 KiB
Bash

#! /bin/bash
########################################################################
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
########################################################################
NOVAOPENRC="/etc/nova/openrc"
if [ -e ${NOVAOPENRC} ] ; then
source ${NOVAOPENRC} &>/dev/null
else
echo "Admin credentials not found"
exit
fi
# Delete all the servers
echo "Deleting all servers [`openstack server list --all`]"
found=false
for i in $(openstack server list --all -c ID -f value); do
`openstack server delete $i &> /dev/null`
echo $i deleted
found=true
done
if $found; then
sleep 30
fi
echo "Deleted all servers [`openstack server list --all`]"
# Delete all the volumes
echo "Deleting all volumes [`openstack volume list --all`]"
found=false
for i in $(openstack volume list --all -c ID -f value); do
`openstack volume delete $i &> /dev/null`
echo $i deleted
found=true
done
if $found; then
sleep 30
fi
echo "Deleted all volumes [`openstack volume list --all`]"