From bd008dbb39456f8bb2ae66001784d9a3922a9e5b Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Wed, 4 Oct 2017 17:09:55 -0700 Subject: [PATCH] Changing client to reflect monitor changes --- examples/client.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/client.go b/examples/client.go index 5719178..69ab478 100644 --- a/examples/client.go +++ b/examples/client.go @@ -513,17 +513,15 @@ func main() { } // Monitor change to DRAINING and DRAINED mode - nontransitioned, err := monitor.HostMaintenance( + hostResult, err := monitor.HostMaintenance( hosts, []aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED, aurora.MaintenanceMode_DRAINING}, 5, 10) if err != nil { - - // Check whether the call was partially successful - if len(nontransitioned) != 0 { - fmt.Println("Partial success:") - for host, _ := range nontransitioned { + fmt.Println("Partial success:") + for host, ok := range hostResult { + if !ok { fmt.Printf("Host %s did not transtion into desired mode(s)\n", host) } } @@ -548,14 +546,14 @@ func main() { } // Monitor change to DRAINING and DRAINED mode - hostsResult, err := monitor.HostMaintenance( + hostResult, err := monitor.HostMaintenance( hosts, []aurora.MaintenanceMode{aurora.MaintenanceMode_NONE}, 5, 10) if err != nil { fmt.Println("Partial success:") - for host, ok := range hostsResult { + for host, ok := range hostResult { if !ok { fmt.Printf("Host %s did not transtion into desired mode(s)\n", host) }