From 62cae13d7e7e13102a02aa385ae63b8e2afb7c83 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 4 Sep 2014 21:25:45 +1000 Subject: [PATCH] Fix tools/xen/functions for bashate errors Change I205d675ff231c0403dd135eacc8d57b45317859f modified the matching for bashate and it has started running on this file, whereas before it wasn't. This fixes the errors it is now picking up. Change-Id: I7876b5c94d90f15e3b0228999c0750bfbebcaa1c --- tools/xen/functions | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/tools/xen/functions b/tools/xen/functions index ab0be84bd2..4317796e39 100644 --- a/tools/xen/functions +++ b/tools/xen/functions @@ -93,7 +93,7 @@ function get_local_sr_path { echo $pbd_path } -function find_ip_by_name() { +function find_ip_by_name { local guest_name="$1" local interface="$2" @@ -121,7 +121,7 @@ function find_ip_by_name() { done } -function _vm_uuid() { +function _vm_uuid { local vm_name_label vm_name_label="$1" @@ -129,14 +129,14 @@ function _vm_uuid() { xe vm-list name-label="$vm_name_label" --minimal } -function _create_new_network() { +function _create_new_network { local name_label name_label=$1 xe network-create name-label="$name_label" } -function _multiple_networks_with_name() { +function _multiple_networks_with_name { local name_label name_label=$1 @@ -144,21 +144,21 @@ function _multiple_networks_with_name() { xe network-list name-label="$name_label" --minimal | grep -q "," } -function _network_exists() { +function _network_exists { local name_label name_label=$1 ! [ -z "$(xe network-list name-label="$name_label" --minimal)" ] } -function _bridge_exists() { +function _bridge_exists { local bridge bridge=$1 ! [ -z "$(xe network-list bridge="$bridge" --minimal)" ] } -function _network_uuid() { +function _network_uuid { local bridge_or_net_name bridge_or_net_name=$1 @@ -169,7 +169,7 @@ function _network_uuid() { fi } -function add_interface() { +function add_interface { local vm_name_label local bridge_or_network_name @@ -185,7 +185,7 @@ function add_interface() { xe vif-create network-uuid=$net vm-uuid=$vm device=$device_number } -function setup_network() { +function setup_network { local bridge_or_net_name bridge_or_net_name=$1 @@ -204,7 +204,7 @@ EOF fi } -function bridge_for() { +function bridge_for { local bridge_or_net_name bridge_or_net_name=$1 @@ -215,29 +215,28 @@ function bridge_for() { fi } -function xenapi_ip_on() { +function xenapi_ip_on { local bridge_or_net_name bridge_or_net_name=$1 ifconfig $(bridge_for "$bridge_or_net_name") | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//" } -function xenapi_is_listening_on() { +function xenapi_is_listening_on { local bridge_or_net_name bridge_or_net_name=$1 ! [ -z $(xenapi_ip_on "$bridge_or_net_name") ] } -function parameter_is_specified() { +function parameter_is_specified { local parameter_name parameter_name=$1 compgen -v | grep "$parameter_name" } -function append_kernel_cmdline() -{ +function append_kernel_cmdline { local vm_name_label local kernel_args @@ -252,8 +251,7 @@ function append_kernel_cmdline() xe vm-param-set PV-args="$pv_args $kernel_args" uuid=$vm } -function destroy_all_vifs_of() -{ +function destroy_all_vifs_of { local vm_name_label vm_name_label="$1" @@ -268,11 +266,11 @@ function destroy_all_vifs_of() unset IFS } -function have_multiple_hosts() { +function have_multiple_hosts { xe host-list --minimal | grep -q "," } -function attach_network() { +function attach_network { local bridge_or_net_name bridge_or_net_name="$1" @@ -286,7 +284,7 @@ function attach_network() { xe network-attach uuid=$net host-uuid=$host } -function set_vm_memory() { +function set_vm_memory { local vm_name_label local memory @@ -305,7 +303,7 @@ function set_vm_memory() { uuid=$vm } -function max_vcpus() { +function max_vcpus { local vm_name_label vm_name_label="$1" @@ -337,7 +335,7 @@ function max_vcpus() { xe vm-param-set uuid=$vm VCPUs-at-startup=$cpu_count } -function get_domid() { +function get_domid { local vm_name_label vm_name_label="$1"