From b20775288379b1ace89a3679ec757426bc026eaa Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Tue, 27 Aug 2019 16:52:52 -0700 Subject: [PATCH 1/2] provisioner/ansible: Fix dropped error --- provisioner/ansible/provisioner.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provisioner/ansible/provisioner.go b/provisioner/ansible/provisioner.go index d61d4d44e..f129d8c79 100644 --- a/provisioner/ansible/provisioner.go +++ b/provisioner/ansible/provisioner.go @@ -240,6 +240,10 @@ func (p *Provisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.C } hostSigner, err := newSigner(p.config.SSHHostKeyFile) + if err != nil { + return fmt.Errorf("error creating host signer: %s", err) + } + // Remove the private key file if len(k.privKeyFile) > 0 { defer os.Remove(k.privKeyFile) From bd01d0d3c37d5df028621c26212b3584a3df48f0 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Tue, 27 Aug 2019 17:01:33 -0700 Subject: [PATCH 2/2] provisioner/inspec: Fix dropped error --- provisioner/inspec/provisioner.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provisioner/inspec/provisioner.go b/provisioner/inspec/provisioner.go index 618802f9f..f9d52d36c 100644 --- a/provisioner/inspec/provisioner.go +++ b/provisioner/inspec/provisioner.go @@ -217,6 +217,10 @@ func (p *Provisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.C } hostSigner, err := newSigner(p.config.SSHHostKeyFile) + if err != nil { + return fmt.Errorf("error creating host signer: %s", err) + } + // Remove the private key file if len(k.privKeyFile) > 0 { defer os.Remove(k.privKeyFile)