Skip to content

Commit 62cae13

Browse files
committed
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
1 parent 6131ff0 commit 62cae13

1 file changed

Lines changed: 20 additions & 22 deletions

File tree

tools/xen/functions

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function get_local_sr_path {
9393
echo $pbd_path
9494
}
9595

96-
function find_ip_by_name() {
96+
function find_ip_by_name {
9797
local guest_name="$1"
9898
local interface="$2"
9999

@@ -121,44 +121,44 @@ function find_ip_by_name() {
121121
done
122122
}
123123

124-
function _vm_uuid() {
124+
function _vm_uuid {
125125
local vm_name_label
126126

127127
vm_name_label="$1"
128128

129129
xe vm-list name-label="$vm_name_label" --minimal
130130
}
131131

132-
function _create_new_network() {
132+
function _create_new_network {
133133
local name_label
134134
name_label=$1
135135

136136
xe network-create name-label="$name_label"
137137
}
138138

139-
function _multiple_networks_with_name() {
139+
function _multiple_networks_with_name {
140140
local name_label
141141
name_label=$1
142142

143143
# A comma indicates multiple matches
144144
xe network-list name-label="$name_label" --minimal | grep -q ","
145145
}
146146

147-
function _network_exists() {
147+
function _network_exists {
148148
local name_label
149149
name_label=$1
150150

151151
! [ -z "$(xe network-list name-label="$name_label" --minimal)" ]
152152
}
153153

154-
function _bridge_exists() {
154+
function _bridge_exists {
155155
local bridge
156156
bridge=$1
157157

158158
! [ -z "$(xe network-list bridge="$bridge" --minimal)" ]
159159
}
160160

161-
function _network_uuid() {
161+
function _network_uuid {
162162
local bridge_or_net_name
163163
bridge_or_net_name=$1
164164

@@ -169,7 +169,7 @@ function _network_uuid() {
169169
fi
170170
}
171171

172-
function add_interface() {
172+
function add_interface {
173173
local vm_name_label
174174
local bridge_or_network_name
175175

@@ -185,7 +185,7 @@ function add_interface() {
185185
xe vif-create network-uuid=$net vm-uuid=$vm device=$device_number
186186
}
187187

188-
function setup_network() {
188+
function setup_network {
189189
local bridge_or_net_name
190190
bridge_or_net_name=$1
191191

@@ -204,7 +204,7 @@ EOF
204204
fi
205205
}
206206

207-
function bridge_for() {
207+
function bridge_for {
208208
local bridge_or_net_name
209209
bridge_or_net_name=$1
210210

@@ -215,29 +215,28 @@ function bridge_for() {
215215
fi
216216
}
217217

218-
function xenapi_ip_on() {
218+
function xenapi_ip_on {
219219
local bridge_or_net_name
220220
bridge_or_net_name=$1
221221

222222
ifconfig $(bridge_for "$bridge_or_net_name") | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//"
223223
}
224224

225-
function xenapi_is_listening_on() {
225+
function xenapi_is_listening_on {
226226
local bridge_or_net_name
227227
bridge_or_net_name=$1
228228

229229
! [ -z $(xenapi_ip_on "$bridge_or_net_name") ]
230230
}
231231

232-
function parameter_is_specified() {
232+
function parameter_is_specified {
233233
local parameter_name
234234
parameter_name=$1
235235

236236
compgen -v | grep "$parameter_name"
237237
}
238238

239-
function append_kernel_cmdline()
240-
{
239+
function append_kernel_cmdline {
241240
local vm_name_label
242241
local kernel_args
243242

@@ -252,8 +251,7 @@ function append_kernel_cmdline()
252251
xe vm-param-set PV-args="$pv_args $kernel_args" uuid=$vm
253252
}
254253

255-
function destroy_all_vifs_of()
256-
{
254+
function destroy_all_vifs_of {
257255
local vm_name_label
258256

259257
vm_name_label="$1"
@@ -268,11 +266,11 @@ function destroy_all_vifs_of()
268266
unset IFS
269267
}
270268

271-
function have_multiple_hosts() {
269+
function have_multiple_hosts {
272270
xe host-list --minimal | grep -q ","
273271
}
274272

275-
function attach_network() {
273+
function attach_network {
276274
local bridge_or_net_name
277275

278276
bridge_or_net_name="$1"
@@ -286,7 +284,7 @@ function attach_network() {
286284
xe network-attach uuid=$net host-uuid=$host
287285
}
288286

289-
function set_vm_memory() {
287+
function set_vm_memory {
290288
local vm_name_label
291289
local memory
292290

@@ -305,7 +303,7 @@ function set_vm_memory() {
305303
uuid=$vm
306304
}
307305

308-
function max_vcpus() {
306+
function max_vcpus {
309307
local vm_name_label
310308

311309
vm_name_label="$1"
@@ -337,7 +335,7 @@ function max_vcpus() {
337335
xe vm-param-set uuid=$vm VCPUs-at-startup=$cpu_count
338336
}
339337

340-
function get_domid() {
338+
function get_domid {
341339
local vm_name_label
342340

343341
vm_name_label="$1"

0 commit comments

Comments
 (0)