From 09469f32169996f96f5e3e7f8e24ba5c5ba18f67 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Fri, 15 Jun 2018 16:07:11 -0700 Subject: [PATCH] Adding interval configuration to stop command. --- cmd/stop.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/stop.go b/cmd/stop.go index fde50da..15df42d 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -13,6 +13,8 @@ func init() { // Stop subcommands stopCmd.AddCommand(stopMaintCmd) + stopMaintCmd.Flags().IntVar(&monitorInterval,"interval", 5, "Interval at which to poll scheduler.") + stopMaintCmd.Flags().IntVar(&monitorTimeout,"timeout", 50, "Time after which the monitor will stop polling and throw an error.") } var stopCmd = &cobra.Command{ @@ -40,8 +42,8 @@ func endMaintenance(cmd *cobra.Command, args []string) { hostResult, err := monitor.HostMaintenance( args, []aurora.MaintenanceMode{aurora.MaintenanceMode_NONE}, - 5, - 10) + monitorInterval, + monitorTimeout) if err != nil { for host, ok := range hostResult { if !ok { @@ -53,5 +55,5 @@ func endMaintenance(cmd *cobra.Command, args []string) { return } - fmt.Print(result.String()) + fmt.Println(result.String()) }