Commit 53b1db16 authored by Emil Hessman's avatar Emil Hessman

post-processor/vagrant: check if vagrantfile_template exists

Fixes #801
parent a65dc929
...@@ -210,6 +210,13 @@ func (p *PostProcessor) configureSingle(config *Config, raws ...interface{}) err ...@@ -210,6 +210,13 @@ func (p *PostProcessor) configureSingle(config *Config, raws ...interface{}) err
"vagrantfile_template": &config.VagrantfileTemplate, "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 { for n, ptr := range validates {
if err := config.tpl.Validate(*ptr); err != nil { if err := config.tpl.Validate(*ptr); err != nil {
errs = packer.MultiErrorAppend( errs = packer.MultiErrorAppend(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment