While loop style change
Instead of using "while [ : ] ; do", use "while : ; do". This makes shellcheck happy. Change-Id: Ice78a901402078a32138250d5b767fed3f8d19d0
This commit is contained in:
@@ -40,7 +40,7 @@ function is_root {
|
||||
function yes_or_no {
|
||||
local prompt=$1
|
||||
local input=""
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
read -p "$prompt (Y/n): " input
|
||||
case "$input" in
|
||||
N|n)
|
||||
|
||||
@@ -203,7 +203,7 @@ function wait_for_ssh {
|
||||
local ssh_port=$1
|
||||
|
||||
echo -e -n "${CStatus:-}Waiting for ssh server to respond on ${CData:-}${SSH_IP:-127.0.0.1}:$ssh_port${CReset:-}."
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
if vm_ssh "$ssh_port" exit ; then
|
||||
break
|
||||
else
|
||||
|
||||
@@ -127,7 +127,7 @@ function node_to_mac {
|
||||
local mac=""
|
||||
|
||||
echo >&2 "Waiting for MAC address."
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
mac=$($VIRSH dumpxml "$node"|grep -Po '[a-z0-9:]{17}'|head -n1) || rc=$?
|
||||
if [ -n "$mac" ]; then
|
||||
echo "$mac"
|
||||
@@ -146,7 +146,7 @@ function mac_to_ip {
|
||||
local ip=""
|
||||
|
||||
echo >&2 "Waiting for IP address."
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
ip=$(sudo arp -n|grep "$mac"|awk '{print $1}') || rc=$?
|
||||
if [ -n "$ip" ]; then
|
||||
echo >&2
|
||||
|
||||
@@ -645,7 +645,7 @@ function disk_delete_child_vms {
|
||||
return 0
|
||||
fi
|
||||
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
local child_uuid=$(get_next_child_uuid "$disk")
|
||||
if [ -n "$child_uuid" ]; then
|
||||
local child_disk=$(disk_to_path "$child_uuid")
|
||||
|
||||
@@ -153,7 +153,7 @@ function get_router_ip_address {
|
||||
local network_part=$(remove_last_octet "$public_network")
|
||||
local line
|
||||
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
line=$(neutron router-port-list -F fixed_ips router|grep "$network_part")
|
||||
if [ -z "$line" ]; then
|
||||
# Wait for the network_part to appear in the list
|
||||
|
||||
@@ -207,7 +207,7 @@ function wait_for_neutron_agents {
|
||||
echo
|
||||
echo "$out"
|
||||
fi
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
neutron agent-list | sort > "$agent_list.new"
|
||||
out=$(comm -13 "$agent_list" "$agent_list.new")
|
||||
if [ -n "$out" ]; then
|
||||
@@ -482,7 +482,7 @@ function instance_status_is {
|
||||
nova list | grep "$DEMO_INSTANCE_NAME" | grep -q "$status"
|
||||
}
|
||||
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
echo "###################################################################"
|
||||
echo "Launching an instance VM ($VM_LAUNCHES)."
|
||||
request_instance > /dev/null
|
||||
@@ -503,7 +503,7 @@ while [ : ]; do
|
||||
|
||||
echo -n "Requesting new instance VMs until it works."
|
||||
cnt=0
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
request_instance >/dev/null
|
||||
if console_status_409; then
|
||||
nova delete "$DEMO_INSTANCE_NAME"
|
||||
@@ -655,7 +655,7 @@ function patient_ping {
|
||||
local ip=$1
|
||||
local cnt=0
|
||||
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
echo -n .
|
||||
sleep 1
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ function check_cinder_services {
|
||||
# status. This method will wait for 20 seconds to get the status of the
|
||||
# Cinder services.
|
||||
local i=1
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
if [[ -z $(node_ssh controller "$AUTH; cinder service-list" | grep down) ]] > /dev/null 2>&1; then
|
||||
echo "Cinder services seem to be up and running!"
|
||||
return 0
|
||||
@@ -190,7 +190,7 @@ function wait_for_cinder_volume {
|
||||
# Wait for cinder volume to be created
|
||||
echo -n 'Waiting for cinder volume to be created.'
|
||||
local i=1
|
||||
while [ : ]; do
|
||||
while : ; do
|
||||
if [[ -z $(node_ssh controller "$AUTH;cinder list" | grep creating) ]] > /dev/null 2>&1; then
|
||||
# Proceed if the state of cinder-volumes is error or created.
|
||||
# Cinder volumes cannot be deleted when it is in creating state.
|
||||
|
||||
Reference in New Issue
Block a user