post-processor/vagrant: check if vagrantfile_template exists

Fixes #801
This commit is contained in:
Emil Hessman 2014-11-25 13:02:32 +01:00
parent a65dc929f2
commit 53b1db1669
1 changed files with 7 additions and 0 deletions

View File

@ -210,6 +210,13 @@ func (p *PostProcessor) configureSingle(config *Config, raws ...interface{}) err
"vagrantfile_template": &config.VagrantfileTemplate,
}
if config.VagrantfileTemplate != "" {
_, err := os.Stat(config.VagrantfileTemplate)
if err != nil {
errs = packer.MultiErrorAppend(errs, fmt.Errorf("vagrantfile_template '%s' does not exist", config.VagrantfileTemplate))
}
}
for n, ptr := range validates {
if err := config.tpl.Validate(*ptr); err != nil {
errs = packer.MultiErrorAppend(