mux on ssh

This commit is contained in:
Martin Geno 2017-07-06 09:57:25 +02:00
parent 3540b638f6
commit fbd01cf7ab
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
1 changed files with 2 additions and 0 deletions

View File

@ -47,7 +47,9 @@ func (m *Manager) run(host string, client *ssh.Client, cmd string) ([]byte, erro
if err != nil { if err != nil {
log.Log.Warnf("can not create session on %s: %s", host, err) log.Log.Warnf("can not create session on %s: %s", host, err)
m.clientsMUX.Lock()
delete(m.clients, host) delete(m.clients, host)
m.clientsMUX.Unlock()
return nil, err return nil, err
} }
stdout, err := session.StdoutPipe() stdout, err := session.StdoutPipe()