From 4a9d42b78fde52000aaf3d18c061a194aa69241a Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 9 Jul 2019 15:26:04 -0700 Subject: [PATCH 1/2] use box_name instead of source_path when generating vagrant file --- builder/vagrant/builder.go | 2 +- builder/vagrant/step_create_vagrantfile.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/vagrant/builder.go b/builder/vagrant/builder.go index 06b22cbcd..338f16de8 100644 --- a/builder/vagrant/builder.go +++ b/builder/vagrant/builder.go @@ -199,7 +199,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack &StepCreateVagrantfile{ Template: b.config.Template, SyncedFolder: b.config.SyncedFolder, - SourceBox: b.config.SourceBox, + BoxName: b.config.BoxName, OutputDir: b.config.OutputDir, GlobalID: b.config.GlobalID, }, diff --git a/builder/vagrant/step_create_vagrantfile.go b/builder/vagrant/step_create_vagrantfile.go index fa01d62a8..1d1c890dd 100644 --- a/builder/vagrant/step_create_vagrantfile.go +++ b/builder/vagrant/step_create_vagrantfile.go @@ -14,10 +14,10 @@ import ( type StepCreateVagrantfile struct { Template string - SourceBox string OutputDir string SyncedFolder string GlobalID string + BoxName string } var DEFAULT_TEMPLATE = `Vagrant.configure("2") do |config| @@ -56,7 +56,7 @@ func (s *StepCreateVagrantfile) createVagrantfile() (string, error) { opts := &VagrantfileOptions{ SyncedFolder: s.SyncedFolder, - BoxName: s.SourceBox, + BoxName: s.BoxName, } err = tpl.Execute(templateFile, opts) From 327cd675576ad8c639bcf15720c38805088f7891 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Tue, 9 Jul 2019 15:42:48 -0700 Subject: [PATCH 2/2] fix tests --- builder/vagrant/step_create_vagrantfile_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/vagrant/step_create_vagrantfile_test.go b/builder/vagrant/step_create_vagrantfile_test.go index d3bcf21b9..50a294499 100644 --- a/builder/vagrant/step_create_vagrantfile_test.go +++ b/builder/vagrant/step_create_vagrantfile_test.go @@ -20,7 +20,7 @@ func TestStepCreateVagrantfile_Impl(t *testing.T) { func TestCreateFile(t *testing.T) { testy := StepCreateVagrantfile{ OutputDir: "./", - SourceBox: "bananas", + BoxName: "bananas", } templatePath, err := testy.createVagrantfile() if err != nil {