don't attempt to delete non-existant key when using agent auth
This commit is contained in:
parent
f95514c120
commit
2cb9b32acf
|
@ -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…
Reference in New Issue