From 5f511f03997934ecbb85d3daf8ca49f221a0a0be Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 10 May 2017 21:11:06 +0800 Subject: [PATCH] fix host Signed-off-by: Bo-Yi Wu --- plugin.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin.go b/plugin.go index abe5c42..25fd899 100644 --- a/plugin.go +++ b/plugin.go @@ -68,9 +68,6 @@ func (p Plugin) Exec() error { countHosts := len(p.Config.Host) for _, host := range p.Config.Host { go func(host string, counts int) { - if counts == 1 { - host = "" - } // Create MakeConfig instance with remote username, server address and path to private key. ssh := &easyssh.MakeConfig{ Server: host, @@ -99,6 +96,10 @@ func (p Plugin) Exec() error { // read from the output channel until the done signal is passed stillGoing := true isTimeout := true + // hide host in log if only single host in config. + if counts == 1 { + host = "" + } for stillGoing { select { case isTimeout = <-doneChan: