final bash8 files for the rest of devstack
With this devstack/master is bash8 clean, and ready for enforcement
Change-Id: I03fc89b401e6b7a23224d71472122c1bfa3ad0bd
diff --git a/tools/xen/scripts/install-os-vpx.sh b/tools/xen/scripts/install-os-vpx.sh
index 7469e0c..7b0d891 100755
--- a/tools/xen/scripts/install-os-vpx.sh
+++ b/tools/xen/scripts/install-os-vpx.sh
@@ -42,69 +42,69 @@
get_params()
{
- while getopts "hbn:r:l:t:" OPTION;
- do
- case $OPTION in
- h) usage
- exit 1
- ;;
- n)
- BRIDGE=$OPTARG
- ;;
- l)
- NAME_LABEL=$OPTARG
- ;;
- t)
- TEMPLATE_NAME=$OPTARG
- ;;
- ?)
- usage
- exit
- ;;
- esac
- done
- if [[ -z $BRIDGE ]]
- then
- BRIDGE=xenbr0
- fi
+ while getopts "hbn:r:l:t:" OPTION;
+ do
+ case $OPTION in
+ h) usage
+ exit 1
+ ;;
+ n)
+ BRIDGE=$OPTARG
+ ;;
+ l)
+ NAME_LABEL=$OPTARG
+ ;;
+ t)
+ TEMPLATE_NAME=$OPTARG
+ ;;
+ ?)
+ usage
+ exit
+ ;;
+ esac
+ done
+ if [[ -z $BRIDGE ]]
+ then
+ BRIDGE=xenbr0
+ fi
- if [[ -z $TEMPLATE_NAME ]]; then
- echo "Please specify a template name" >&2
- exit 1
- fi
+ if [[ -z $TEMPLATE_NAME ]]; then
+ echo "Please specify a template name" >&2
+ exit 1
+ fi
- if [[ -z $NAME_LABEL ]]; then
- echo "Please specify a name-label for the new VM" >&2
- exit 1
- fi
+ if [[ -z $NAME_LABEL ]]; then
+ echo "Please specify a name-label for the new VM" >&2
+ exit 1
+ fi
}
xe_min()
{
- local cmd="$1"
- shift
- xe "$cmd" --minimal "$@"
+ local cmd="$1"
+ shift
+ xe "$cmd" --minimal "$@"
}
find_network()
{
- result=$(xe_min network-list bridge="$1")
- if [ "$result" = "" ]
- then
- result=$(xe_min network-list name-label="$1")
- fi
- echo "$result"
+ result=$(xe_min network-list bridge="$1")
+ if [ "$result" = "" ]
+ then
+ result=$(xe_min network-list name-label="$1")
+ fi
+ echo "$result"
}
create_vif()
{
- local v="$1"
- echo "Installing VM interface on [$BRIDGE]"
- local out_network_uuid=$(find_network "$BRIDGE")
- xe vif-create vm-uuid="$v" network-uuid="$out_network_uuid" device="0"
+ local v="$1"
+ echo "Installing VM interface on [$BRIDGE]"
+ local out_network_uuid=$(find_network "$BRIDGE")
+ xe vif-create vm-uuid="$v" network-uuid="$out_network_uuid" device="0"
}
@@ -112,20 +112,20 @@
# Make the VM auto-start on server boot.
set_auto_start()
{
- local v="$1"
- xe vm-param-set uuid="$v" other-config:auto_poweron=true
+ local v="$1"
+ xe vm-param-set uuid="$v" other-config:auto_poweron=true
}
destroy_vifs()
{
- local v="$1"
- IFS=,
- for vif in $(xe_min vif-list vm-uuid="$v")
- do
- xe vif-destroy uuid="$vif"
- done
- unset IFS
+ local v="$1"
+ IFS=,
+ for vif in $(xe_min vif-list vm-uuid="$v")
+ do
+ xe vif-destroy uuid="$vif"
+ done
+ unset IFS
}
diff --git a/tools/xen/scripts/uninstall-os-vpx.sh b/tools/xen/scripts/uninstall-os-vpx.sh
index ac26094..1ed2494 100755
--- a/tools/xen/scripts/uninstall-os-vpx.sh
+++ b/tools/xen/scripts/uninstall-os-vpx.sh
@@ -22,63 +22,63 @@
# By default, don't remove the templates
REMOVE_TEMPLATES=${REMOVE_TEMPLATES:-"false"}
if [ "$1" = "--remove-templates" ]; then
- REMOVE_TEMPLATES=true
+ REMOVE_TEMPLATES=true
fi
xe_min()
{
- local cmd="$1"
- shift
- xe "$cmd" --minimal "$@"
+ local cmd="$1"
+ shift
+ xe "$cmd" --minimal "$@"
}
destroy_vdi()
{
- local vbd_uuid="$1"
- local type=$(xe_min vbd-list uuid=$vbd_uuid params=type)
- local dev=$(xe_min vbd-list uuid=$vbd_uuid params=userdevice)
- local vdi_uuid=$(xe_min vbd-list uuid=$vbd_uuid params=vdi-uuid)
+ local vbd_uuid="$1"
+ local type=$(xe_min vbd-list uuid=$vbd_uuid params=type)
+ local dev=$(xe_min vbd-list uuid=$vbd_uuid params=userdevice)
+ local vdi_uuid=$(xe_min vbd-list uuid=$vbd_uuid params=vdi-uuid)
- if [ "$type" == 'Disk' ] && [ "$dev" != 'xvda' ] && [ "$dev" != '0' ]; then
- xe vdi-destroy uuid=$vdi_uuid
- fi
+ if [ "$type" == 'Disk' ] && [ "$dev" != 'xvda' ] && [ "$dev" != '0' ]; then
+ xe vdi-destroy uuid=$vdi_uuid
+ fi
}
uninstall()
{
- local vm_uuid="$1"
- local power_state=$(xe_min vm-list uuid=$vm_uuid params=power-state)
+ local vm_uuid="$1"
+ local power_state=$(xe_min vm-list uuid=$vm_uuid params=power-state)
- if [ "$power_state" != "halted" ]; then
- xe vm-shutdown vm=$vm_uuid force=true
- fi
+ if [ "$power_state" != "halted" ]; then
+ xe vm-shutdown vm=$vm_uuid force=true
+ fi
- for v in $(xe_min vbd-list vm-uuid=$vm_uuid | sed -e 's/,/ /g'); do
- destroy_vdi "$v"
- done
+ for v in $(xe_min vbd-list vm-uuid=$vm_uuid | sed -e 's/,/ /g'); do
+ destroy_vdi "$v"
+ done
- xe vm-uninstall vm=$vm_uuid force=true >/dev/null
+ xe vm-uninstall vm=$vm_uuid force=true >/dev/null
}
uninstall_template()
{
- local vm_uuid="$1"
+ local vm_uuid="$1"
- for v in $(xe_min vbd-list vm-uuid=$vm_uuid | sed -e 's/,/ /g'); do
- destroy_vdi "$v"
- done
+ for v in $(xe_min vbd-list vm-uuid=$vm_uuid | sed -e 's/,/ /g'); do
+ destroy_vdi "$v"
+ done
- xe template-uninstall template-uuid=$vm_uuid force=true >/dev/null
+ xe template-uninstall template-uuid=$vm_uuid force=true >/dev/null
}
# remove the VMs and their disks
for u in $(xe_min vm-list other-config:os-vpx=true | sed -e 's/,/ /g'); do
- uninstall "$u"
+ uninstall "$u"
done
# remove the templates
if [ "$REMOVE_TEMPLATES" == "true" ]; then
- for u in $(xe_min template-list other-config:os-vpx=true | sed -e 's/,/ /g'); do
- uninstall_template "$u"
- done
+ for u in $(xe_min template-list other-config:os-vpx=true | sed -e 's/,/ /g'); do
+ uninstall_template "$u"
+ done
fi