Merge pull request #8045 from alrs/fix-provisioner-dropped-errors

Fix provisioner dropped errors
This commit is contained in:
Adrien Delorme 2019-08-28 10:20:46 +02:00 committed by GitHub
commit 4b1c766c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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)