we lost the skip_add step somewhere

pull/7221/head
Megan Marsh 7 years ago
parent 5057220ad2
commit 9f702af6d9

@ -223,6 +223,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SourceBox: b.config.SourceBox,
BoxName: b.config.BoxName,
GlobalID: b.config.GlobalID,
SkipAdd: b.config.SkipAdd,
},
&StepUp{
TeardownMethod: b.config.TeardownMethod,

@ -21,10 +21,10 @@ type StepAddBox struct {
SourceBox string
BoxName string
GlobalID string
SkipAdd bool
}
func (s *StepAddBox) generateAddArgs() []string {
addArgs := []string{}
if strings.HasSuffix(s.SourceBox, ".box") {
@ -72,6 +72,11 @@ func (s *StepAddBox) Run(_ context.Context, state multistep.StateBag) multistep.
driver := state.Get("driver").(VagrantDriver)
ui := state.Get("ui").(packer.Ui)
if s.SkipAdd {
ui.Say("skip_add was set so we assume the box is already in Vagrant...")
return multistep.ActionContinue
}
if s.GlobalID != "" {
ui.Say("Using a global-id; skipping Vagrant add command...")
return multistep.ActionContinue

Loading…
Cancel
Save