Move e2e SSH utils to e2e/ssh package; improve SSH logging.

This commit is contained in:
Max Forbes
2015-07-23 16:44:09 -07:00
parent 45def3f3f3
commit e24ab02f05
9 changed files with 153 additions and 89 deletions

View File

@@ -22,6 +22,8 @@ import (
"net"
"strings"
"sync"
"github.com/GoogleCloudPlatform/kubernetes/test/e2e/ssh"
)
type command struct {
@@ -44,7 +46,7 @@ func coreDump(dir string) {
}
// Get all nodes' external IPs.
hosts, err := NodeSSHHosts(c)
hosts, err := ssh.NodeSSHHosts(c)
if err != nil {
fmt.Printf("Error getting node hostnames: %v", err)
return
@@ -85,7 +87,7 @@ func logCore(cmds []command, hosts []string, dir, provider string) {
defer wg.Done()
logfile := fmt.Sprintf("%s/%s-%s.log", dir, host, cmd.component)
fmt.Printf("Writing to %s.\n", logfile)
stdout, stderr, _, err := SSH(cmd.cmd, host, provider)
stdout, stderr, _, err := ssh.SSH(cmd.cmd, host, provider)
if err != nil {
fmt.Printf("Error running command: %v\n", err)
}