Adding initial support for printing results in JSON format. Adding Logrus logging and adding a logging level argument. Adding StartMaintenance API.
This commit is contained in:
parent
6ce6411ee0
commit
a559137fe3
5 changed files with 145 additions and 61 deletions
27
cmd/stop.go
27
cmd/stop.go
|
@ -61,30 +61,11 @@ func endMaintenance(cmd *cobra.Command, args []string) {
|
|||
monitorInterval,
|
||||
monitorTimeout)
|
||||
|
||||
transitioned := make([]string, 0,0)
|
||||
|
||||
maintenanceMonitorPrint(hostResult,[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE})
|
||||
|
||||
if err != nil {
|
||||
nonTransitioned := make([]string, 0,0)
|
||||
|
||||
for host, ok := range hostResult {
|
||||
if ok {
|
||||
transitioned = append(transitioned, host)
|
||||
} else {
|
||||
nonTransitioned = append(nonTransitioned, host)
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("error: %+v\n", err)
|
||||
if toJson {
|
||||
fmt.Println(toJSON(nonTransitioned))
|
||||
} else {
|
||||
fmt.Println("Did not enter NONE status: ", nonTransitioned)
|
||||
}
|
||||
}
|
||||
|
||||
if toJson {
|
||||
fmt.Println(toJSON(transitioned))
|
||||
} else {
|
||||
fmt.Println("Entered NONE status: ", transitioned)
|
||||
log.Fatalln("error: %+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue