diff --git a/builder/amazon/common/run_config.go b/builder/amazon/common/run_config.go index 67ec74d79..d4ebec0e1 100644 --- a/builder/amazon/common/run_config.go +++ b/builder/amazon/common/run_config.go @@ -87,7 +87,7 @@ func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error { } // if we are not given an explicit keypairname, create a temporary one - if c.SSHKeyPairName == "" { + if c.SSHKeyPairName == "" { c.TemporaryKeyPairName = fmt.Sprintf( "packer %s", uuid.TimeOrderedUUID()) } diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index a4baf8e0b..3f40e3d77 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -11,20 +11,20 @@ import ( ) type StepKeyPair struct { - Debug bool - DebugKeyPath string - TemporaryKeyPairName string - KeyPairName string - PrivateKeyFile string + Debug bool + DebugKeyPath string + TemporaryKeyPairName string + KeyPairName string + PrivateKeyFile string keyName string } func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction { if s.PrivateKeyFile != "" { - if s.KeyPairName != "" { - s.keyName = s.KeyPairName // need to get from config - } + if s.KeyPairName != "" { + s.keyName = s.KeyPairName // need to get from config + } privateKeyBytes, err := ioutil.ReadFile(s.PrivateKeyFile) if err != nil { @@ -86,8 +86,8 @@ func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction { func (s *StepKeyPair) Cleanup(state multistep.StateBag) { // If no key name is set, then we never created it, so just return - // If we used an SSH private key file, do not go about deleting - // keypairs + // If we used an SSH private key file, do not go about deleting + // keypairs if s.PrivateKeyFile != "" { return } @@ -98,7 +98,7 @@ func (s *StepKeyPair) Cleanup(state multistep.StateBag) { ui.Say("Deleting temporary keypair...") _, err := ec2conn.DeleteKeyPair(s.keyName) if err != nil { - ui.Error(fmt.Sprintf( - "Error cleaning up keypair. Please delete the key manually: %s", s.keyName)) + ui.Error(fmt.Sprintf( + "Error cleaning up keypair. Please delete the key manually: %s", s.keyName)) } } diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 95e7ea016..0c2258ad6 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -91,7 +91,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe &awscommon.StepKeyPair{ Debug: b.config.PackerDebug, DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName), - TemporaryKeyPairName: b.config.TemporaryKeyPairName, + TemporaryKeyPairName: b.config.TemporaryKeyPairName, KeyPairName: b.config.SSHKeyPairName, PrivateKeyFile: b.config.SSHPrivateKeyFile, }, diff --git a/builder/amazon/instance/builder.go b/builder/amazon/instance/builder.go index b677f4da9..538e9efb7 100644 --- a/builder/amazon/instance/builder.go +++ b/builder/amazon/instance/builder.go @@ -196,7 +196,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe &awscommon.StepKeyPair{ Debug: b.config.PackerDebug, DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName), - TemporaryKeyPairName: b.config.TemporaryKeyPairName, + TemporaryKeyPairName: b.config.TemporaryKeyPairName, KeyPairName: b.config.SSHKeyPairName, PrivateKeyFile: b.config.SSHPrivateKeyFile, },