diff --git a/communicator/none/communicator.go b/communicator/none/communicator.go index 8b0603f01..d903f1c90 100644 --- a/communicator/none/communicator.go +++ b/communicator/none/communicator.go @@ -2,13 +2,13 @@ package none import ( "errors" + "github.com/mitchellh/packer/packer" "io" "os" - "github.com/mitchellh/packer/packer" ) type comm struct { - config string + config string } // Creates a null packer.Communicator implementation. This takes @@ -16,7 +16,7 @@ type comm struct { func New(config string) (result *comm, err error) { // Establish an initial connection and connect result = &comm{ - config: config, + config: config, } return diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index eaccd0dab..ba2a394b0 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -147,8 +147,8 @@ func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) { User: c.config.Username, Password: c.config.Password, }, - Https: c.config.Https, - Insecure: c.config.Insecure, + Https: c.config.Https, + Insecure: c.config.Insecure, OperationTimeout: c.config.Timeout, MaxOperationsPerShell: 15, // lowest common denominator }) diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index 41729efec..f4d1499b7 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -5,9 +5,9 @@ import ( "log" "github.com/mitchellh/multistep" - gossh "golang.org/x/crypto/ssh" - "github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/communicator/none" + "github.com/mitchellh/packer/packer" + gossh "golang.org/x/crypto/ssh" ) // StepConnect is a multistep Step implementation that connects to @@ -77,7 +77,7 @@ func (s *StepConnect) Run(state multistep.StateBag) multistep.StepAction { ui.Error(err.Error()) return multistep.ActionHalt } - state.Put("communicator", comm) + state.Put("communicator", comm) log.Printf("[INFO] communicator disabled, will not connect") return multistep.ActionContinue } diff --git a/plugin/post-processor-shell-local/main.go b/plugin/post-processor-shell-local/main.go index 2f0dd88cf..26ab250bd 100644 --- a/plugin/post-processor-shell-local/main.go +++ b/plugin/post-processor-shell-local/main.go @@ -1,8 +1,8 @@ package main import ( - "github.com/mitchellh/packer/post-processor/shell-local" "github.com/mitchellh/packer/packer/plugin" + "github.com/mitchellh/packer/post-processor/shell-local" ) func main() { diff --git a/provisioner/ansible/provisioner.go b/provisioner/ansible/provisioner.go index f98a6c094..04efe52b4 100644 --- a/provisioner/ansible/provisioner.go +++ b/provisioner/ansible/provisioner.go @@ -111,17 +111,17 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { type Keys struct { //! This is the public key that we will allow to authenticate - public ssh.PublicKey + public ssh.PublicKey //! This is the name of the file of the private key that coorlates //the the public key filename string - + //! This is the servers private key ( Set in case the public key - //is autogenerated ) - private ssh.Signer + //is autogenerated ) + private ssh.Signer - //! This is the flag to say the server key was generated + //! This is the flag to say the server key was generated generated bool } @@ -133,7 +133,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { var private ssh.Signer var filename string = "" var generated bool = false - + if len(pubKeyFile) > 0 { pubKeyBytes, err := ioutil.ReadFile(pubKeyFile) if err != nil { @@ -177,7 +177,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { filename = tf.Name() } - if len(privKeyFile) > 0 { + if len(privKeyFile) > 0 { privateBytes, err := ioutil.ReadFile(privKeyFile) if err != nil { return nil, errors.New("Failed to load private host key") @@ -192,14 +192,14 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { if err != nil { return nil, errors.New("Failed to generate server key pair") } - + private, err = ssh.NewSignerFromKey(key) if err != nil { return nil, errors.New("Failed to extract private key from generated key pair") } generated = true } - return &Keys { public, filename, private, generated },nil + return &Keys{public, filename, private, generated}, nil } k, err := keyFactory(p.config.SSHAuthorizedKeyFile, p.config.SSHHostKeyFile) @@ -227,7 +227,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { return nil, nil }, } - + config := &ssh.ServerConfig{ AuthLogCallback: func(conn ssh.ConnMetadata, method string, err error) { ui.Say(fmt.Sprintf("authentication attempt from %s to %s as %s using %s", conn.RemoteAddr(), conn.LocalAddr(), conn.User(), method)) @@ -321,20 +321,20 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator, aut playbook, _ := filepath.Abs(p.config.PlaybookFile) inventory := p.config.inventoryFile - args := []string{playbook, "-i", inventory } + args := []string{playbook, "-i", inventory} if len(authToken) > 0 { - args = append(args,"--private-key",authToken) + args = append(args, "--private-key", authToken) } args = append(args, p.config.ExtraArguments...) - + cmd := exec.Command(p.config.Command, args...) // If we have autogenerated the key files turn off host key checking if generated { cmd.Env = os.Environ() - cmd.Env = append(cmd.Env,"ANSIBLE_HOST_KEY_CHECKING=False") + cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False") } - + stdout, err := cmd.StdoutPipe() if err != nil { return err diff --git a/provisioner/chef-client/provisioner_test.go b/provisioner/chef-client/provisioner_test.go index 7cc1bbe94..89eb05a6c 100644 --- a/provisioner/chef-client/provisioner_test.go +++ b/provisioner/chef-client/provisioner_test.go @@ -216,7 +216,7 @@ func TestProvisioner_removeDir(t *testing.T) { for _, sudo := range []bool{true, false} { config := testConfig() config["prevent_sudo"] = !sudo - + p := &Provisioner{} comm := &packer.MockCommunicator{} ui := &packer.BasicUi{ diff --git a/provisioner/guest_commands.go b/provisioner/guest_commands.go index 85d45a05b..0403ec55b 100644 --- a/provisioner/guest_commands.go +++ b/provisioner/guest_commands.go @@ -69,4 +69,4 @@ func (g *GuestCommands) sudo(cmd string) string { return "sudo " + cmd } return cmd -} \ No newline at end of file +} diff --git a/provisioner/guest_commands_test.go b/provisioner/guest_commands_test.go index dcf2212ea..50d15870a 100644 --- a/provisioner/guest_commands_test.go +++ b/provisioner/guest_commands_test.go @@ -117,4 +117,4 @@ func TestRemoveDir(t *testing.T) { if cmd != "powershell.exe -Command \"rm C:\\Temp\\Some` Dir -recurse -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } -} \ No newline at end of file +}