don't attempt to delete non-existant key when using agent auth

pull/4597/head
Matthew Hooker 9 years ago
parent f95514c120
commit 2cb9b32acf
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1

@ -107,7 +107,7 @@ 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 s.PrivateKeyFile != "" || s.KeyPairName != "" {
if s.PrivateKeyFile != "" || (s.KeyPairName == "" && s.keyName == "") {
return
}

Loading…
Cancel
Save