Skip to content

Commit

Permalink
Merge pull request #6129 from hashicorp/bc_replace
Browse files Browse the repository at this point in the history
Replace boot command parser with PEG parser.
  • Loading branch information
mwhooker authored Apr 20, 2018
2 parents 8079616 + b5a97e4 commit 024fac4
Show file tree
Hide file tree
Showing 95 changed files with 8,212 additions and 3,001 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ package:

deps:
@go get golang.org/x/tools/cmd/stringer
@go get -u github.com/mna/pigeon
@go get github.com/kardianos/govendor
@govendor sync

Expand Down Expand Up @@ -73,6 +74,8 @@ fmt-examples:
# source files.
generate: deps ## Generate dynamically generated code
go generate .
gofmt -w common/bootcommand/boot_command.go
goimports -w common/bootcommand/boot_command.go
gofmt -w command/plugin.go

test: deps fmt-check ## Run unit tests
Expand Down
33 changes: 0 additions & 33 deletions builder/hyperv/common/run_config.go

This file was deleted.

37 changes: 0 additions & 37 deletions builder/hyperv/common/run_config_test.go

This file was deleted.

19 changes: 0 additions & 19 deletions builder/hyperv/common/step_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ package common
import (
"context"
"fmt"
"time"

"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)

type StepRun struct {
BootWait time.Duration

vmName string
}

Expand All @@ -32,22 +29,6 @@ func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.Ste

s.vmName = vmName

if int64(s.BootWait) > 0 {
ui.Say(fmt.Sprintf("Waiting %s for boot...", s.BootWait))
wait := time.After(s.BootWait)
WAITLOOP:
for {
select {
case <-wait:
break WAITLOOP
case <-time.After(1 * time.Second):
if _, ok := state.GetOk(multistep.StateCancelled); ok {
return multistep.ActionHalt
}
}
}
}

return multistep.ActionContinue
}

Expand Down
Loading

0 comments on commit 024fac4

Please sign in to comment.