communicator/ssh: update logging
This commit is contained in:
parent
310d37dba3
commit
acf31c31a1
|
@ -240,19 +240,19 @@ func (c *comm) connectToAgent() {
|
||||||
// open connection to the local agent
|
// open connection to the local agent
|
||||||
socketLocation := os.Getenv("SSH_AUTH_SOCK")
|
socketLocation := os.Getenv("SSH_AUTH_SOCK")
|
||||||
if socketLocation == "" {
|
if socketLocation == "" {
|
||||||
log.Printf("no local agent socket")
|
log.Printf("[INFO] no local agent socket, will not connect agent")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
agentConn, err := net.Dial("unix", socketLocation)
|
agentConn, err := net.Dial("unix", socketLocation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("could not connect to local agent socket: %s", socketLocation)
|
log.Printf("[ERROR] could not connect to local agent socket: %s", socketLocation)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// create agent and add in auth
|
// create agent and add in auth
|
||||||
forwardingAgent := agent.NewClient(agentConn)
|
forwardingAgent := agent.NewClient(agentConn)
|
||||||
if forwardingAgent == nil {
|
if forwardingAgent == nil {
|
||||||
log.Printf("could not create agent client")
|
log.Printf("[ERROR] Could not create agent client")
|
||||||
agentConn.Close()
|
agentConn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -272,11 +272,11 @@ func (c *comm) connectToAgent() {
|
||||||
|
|
||||||
err = agent.RequestAgentForwarding(session)
|
err = agent.RequestAgentForwarding(session)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("RequestAgentForwarding:", err)
|
log.Printf("[ERROR] RequestAgentForwarding: %#v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("agent forwarding enabled")
|
log.Printf("[INFO] agent forwarding enabled")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue