Permalink
Browse files

minor comment fixes

  • Loading branch information...
ben-st committed May 3, 2017
1 parent 866aa98 commit 8a2e54ff851186a57a9c8422e37739df5f7688d1
Showing with 10 additions and 8 deletions.
  1. +3 −2 config.go
  2. +2 −2 input.go
  3. +5 −4 ssh.go
View
@@ -3,8 +3,9 @@ package main
import (
"errors"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"gopkg.in/yaml.v2"
)
type (
@@ -36,7 +37,7 @@ func (conf *config) set(configPath configPath) error {
return conf.newError(fmt.Sprintf("Could not open %s ", configPath))
}
if err := yaml.Unmarshal([]byte(data), &conf); err != nil {
return conf.newError(fmt.Sprintf("Could not parse config file. make sure its yaml."))
return conf.newError(fmt.Sprintf("Could not parse config file. Make sure its yaml."))
}
return nil
}
View
@@ -27,7 +27,7 @@ type (
func getInputData() *input {
verifyActionFlagPtr := flag.Bool("y", false, "force yes")
asyncFlagPtr := flag.Bool("async", false, "async - when true, parallel executing over servers")
asyncFlagPtr := flag.Bool("async", false, "async - if true, parallel executing over servers")
configPathPtr := flag.String("c", "", "config file - yaml config file")
keyPathPtr := flag.String("i", "", "identity file - path to private key")
serverGroupPtr := flag.String("s", "", "server group - name of the server group")
@@ -74,7 +74,7 @@ func (val *configPath) validate(input *input) inputError {
func (val *keyPath) validate(input *input) inputError {
if *val == "" {
return input.newError("idendity file path is empty please set grapes -i ~/.ssh/id_rsaa")
return input.newError("identity file path is empty please set grapes -i ~/.ssh/id_rsa")
}
return nil
}
View
9 ssh.go
@@ -4,9 +4,10 @@ import (
"bytes"
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net"
"golang.org/x/crypto/ssh"
)
type (
@@ -39,7 +40,7 @@ func (gSSH *grapeSSH) setKey(keyPath keyPath) sshError {
}
privateKey, err := ssh.ParsePrivateKey(privateBytes)
if err != nil {
return gSSH.newError(fmt.Sprint("Could not parse idendity file."))
return gSSH.newError(fmt.Sprint("Could not parse identity file."))
}
gSSH.keySigner = privateKey
return nil
@@ -59,7 +60,7 @@ func (gSSH *grapeSSH) newClient(server server) (*grapeSSHClient, sshError) {
},
})
if err != nil {
return nil, gSSH.newError("Could not established ssh connection")
return nil, gSSH.newError("Could not establish ssh connection")
}
return &grapeSSHClient{client}, nil
}
@@ -70,7 +71,7 @@ func (client *grapeSSHClient) execCommand(cmd command) *sshOutput {
}
session, err := client.NewSession()
if err != nil {
output.Std.Err = "could not establish ssh session"
output.Std.Err = "Could not establish ssh session"
} else {
var stderr, stdout bytes.Buffer
session.Stdout, session.Stderr = &stdout, &stderr

0 comments on commit 8a2e54f

Please sign in to comment.