From d5f88b154ffbd8b83c3fe0727a54837568d2c2d0 Mon Sep 17 00:00:00 2001 From: Anish Bhatt Date: Tue, 11 Dec 2018 10:34:07 -0800 Subject: [PATCH] Better fix for #7095 --- common/step_cleanup_temp_keys.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/step_cleanup_temp_keys.go b/common/step_cleanup_temp_keys.go index 64d623d8b..1d5fec1e5 100644 --- a/common/step_cleanup_temp_keys.go +++ b/common/step_cleanup_temp_keys.go @@ -19,13 +19,6 @@ func (s *StepCleanupTempKeys) Run(_ context.Context, state multistep.StateBag) m // so there's no realistic situation where these keys can cause issues. // However, it's nice to clean up after yourself. - if s.Comm.Type == "none" { - return multistep.ActionContinue - } - - comm := state.Get("communicator").(packer.Communicator) - ui := state.Get("ui").(packer.Ui) - if !s.Comm.SSHClearAuthorizedKeys { return multistep.ActionContinue } @@ -38,6 +31,9 @@ func (s *StepCleanupTempKeys) Run(_ context.Context, state multistep.StateBag) m return multistep.ActionContinue } + comm := state.Get("communicator").(packer.Communicator) + ui := state.Get("ui").(packer.Ui) + cmd := new(packer.RemoteCmd) ui.Say("Trying to remove ephemeral keys from authorized_keys files")