From d66490ebfde952c9871c8879b67a4c90e3c0da8c Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Thu, 27 Oct 2016 23:06:13 +0200 Subject: [PATCH] Properly cleanup AWS temporary key pairs Closes #4057 - Amazon key pair no longer cleaned up at end of build --- builder/amazon/common/step_key_pair.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index 0a3cb1cb5..0cb35f15e 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -95,7 +95,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 != "" { return }