@@ -206,7 +206,7 @@ func DestroyOneMachine(clusterName string, machineType string) {
206
206
Byf ("Listing machines with %q" , matcher )
207
207
listResp , err := client .VirtualMachine .ListVirtualMachines (client .VirtualMachine .NewListVirtualMachinesParams ())
208
208
if err != nil {
209
- Fail ("Failed to list machines" )
209
+ Fail ("Failed to list machines: " + err . Error () )
210
210
}
211
211
var vmToDestroy * cloudstack.VirtualMachine
212
212
originalCount := 0
@@ -224,13 +224,13 @@ func DestroyOneMachine(clusterName string, machineType string) {
224
224
stopParams .SetForced (true )
225
225
_ , err = client .VirtualMachine .StopVirtualMachine (stopParams )
226
226
if err != nil {
227
- Fail ("Failed to stop machine" )
227
+ Fail ("Failed to stop machine: " + err . Error () )
228
228
}
229
229
destroyParams := client .VirtualMachine .NewDestroyVirtualMachineParams (vmToDestroy .Id )
230
230
destroyParams .SetExpunge (true )
231
231
_ , err = client .VirtualMachine .DestroyVirtualMachine (destroyParams )
232
232
if err != nil {
233
- Fail ("Failed to destroy machine" )
233
+ Fail ("Failed to destroy machine: " + err . Error () )
234
234
}
235
235
}
236
236
@@ -252,7 +252,7 @@ func CheckAffinityGroup(clusterName string, affinityType string) []string {
252
252
By ("Listing all machines" )
253
253
listResp , err := client .VirtualMachine .ListVirtualMachines (client .VirtualMachine .NewListVirtualMachinesParams ())
254
254
if err != nil {
255
- Fail ("Failed to list machines" )
255
+ Fail ("Failed to list machines: " + err . Error () )
256
256
}
257
257
affinityTypeString := strings .Title (fmt .Sprintf ("%sAffinity" , affinityType ))
258
258
cpHostIdSet := make (map [string ]bool )
@@ -271,7 +271,7 @@ func CheckAffinityGroup(clusterName string, affinityType string) []string {
271
271
affinityIds = append (affinityIds , affinity .Id )
272
272
affinity , _ , _ := client .AffinityGroup .GetAffinityGroupByID (affinity .Id )
273
273
if err != nil {
274
- Fail ("Failed to get affinity group for " + affinity .Id )
274
+ Fail ("Failed to get affinity group for " + affinity .Id + " : " + err . Error () )
275
275
}
276
276
if ! strings .Contains (affinity .Name , affinityTypeString ) {
277
277
Fail (affinity .Name + " does not contain " + affinityTypeString )
@@ -307,11 +307,11 @@ func createCloudStackClient() *cloudstack.CloudStackClient {
307
307
encodedSecret := os .Getenv ("CLOUDSTACK_B64ENCODED_SECRET" )
308
308
secret , err := base64 .StdEncoding .DecodeString (encodedSecret )
309
309
if err != nil {
310
- Fail ("Failed " )
310
+ Fail ("Failed to decode: " + err . Error () )
311
311
}
312
312
cfg := & cloudConfig {VerifySSL : true }
313
313
if rawCfg , err := ini .Load (secret ); err != nil {
314
- Fail ("Failed to load INI file" )
314
+ Fail ("Failed to load INI file: " + err . Error () )
315
315
} else if g := rawCfg .Section ("Global" ); len (g .Keys ()) == 0 {
316
316
Fail ("Global section not found" )
317
317
} else if err = rawCfg .Section ("Global" ).StrictMapTo (cfg ); err != nil {
@@ -448,7 +448,7 @@ func CheckDiskOfferingOfVmInstances(clusterName string, diskOfferingName string)
448
448
Byf ("Listing machines with %q" , clusterName )
449
449
listResp , err := client .VirtualMachine .ListVirtualMachines (client .VirtualMachine .NewListVirtualMachinesParams ())
450
450
if err != nil {
451
- Fail ("Failed to list machines" )
451
+ Fail ("Failed to list machines: " + err . Error () )
452
452
}
453
453
for _ , vm := range listResp .VirtualMachines {
454
454
if strings .Contains (vm .Name , clusterName ) {
@@ -462,7 +462,7 @@ func CheckVolumeSizeofVmInstances(clusterName string, volumeSize int64) {
462
462
Byf ("Listing machines with %q" , clusterName )
463
463
listResp , err := client .VirtualMachine .ListVirtualMachines (client .VirtualMachine .NewListVirtualMachinesParams ())
464
464
if err != nil {
465
- Fail ("Failed to list machines" )
465
+ Fail ("Failed to list machines: " + err . Error () )
466
466
}
467
467
for _ , vm := range listResp .VirtualMachines {
468
468
if strings .Contains (vm .Name , clusterName ) {
0 commit comments