diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-09-23 23:43:58 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-09-23 23:43:58 (GMT) |
commit | 77b9b4340d4d49ccc11753900854b3577c7afed2 (patch) | |
tree | 9eca08dfde6214c71d7760b58aacbbe2ffa07f58 | |
parent | 07f53fbec0571cbb923bc3431a4bb9b012fcaf78 (diff) |
return true when reconcile is called for already active server
-rw-r--r-- | src/rhctl/switch_control.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rhctl/switch_control.go b/src/rhctl/switch_control.go index 043d682..9fd55ea 100644 --- a/src/rhctl/switch_control.go +++ b/src/rhctl/switch_control.go @@ -268,12 +268,16 @@ func (ctrl *SwitchControl) reconcile(requestedServer string) (result bool) { } ctrl.state.ActiveServer = swsrv - if requestedServer != "" && ctrl.state.ActiveServer != requestedServer { - if ctrl.checkAndSelectServer(requestedServer) { - rhl.Printf("SwitchCTRL: switching to requested server '%s' ...", requestedServer) - result = true + if requestedServer != "" { + if ctrl.state.ActiveServer != requestedServer { + if ctrl.checkAndSelectServer(requestedServer) { + rhl.Printf("SwitchCTRL: switching to requested server '%s' ...", requestedServer) + result = true + } else { + rhl.Printf("SwitchCTRL: requested server '%s' is not selectable, ignoring request", requestedServer) + } } else { - rhl.Printf("SwitchCTRL: requested server '%s' is not selectable, ignoring request", requestedServer) + result = true } } else { if s.Channel != swch { |