Merge pull request #8321 from hashicorp/do_8306

use absolute path for vagrantfile to avoid confusion with build direc…
This commit is contained in:
Adrien Delorme 2019-11-05 14:18:16 +01:00 committed by GitHub
commit f62f23d576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -184,6 +184,14 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
}
if b.config.OutputVagrantfile != "" {
b.config.OutputVagrantfile, err = filepath.Abs(b.config.OutputVagrantfile)
if err != nil {
packer.MultiErrorAppend(errs,
fmt.Errorf("unable to determine absolute path for output vagrantfile: %s", err))
}
}
if b.config.TeardownMethod == "" {
// If we're using a box that's already opened on the system, don't
// automatically destroy it. If we open the box ourselves, then go ahead