From 4c5a7e08b55fba69e7c8b2fae53721f719866b83 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 17 Jan 2018 19:48:21 -0800 Subject: [PATCH 01/19] remove multistep vendor dep --- .../github.com/mitchellh/multistep/LICENSE.md | 22 ---- .../github.com/mitchellh/multistep/README.md | 59 --------- .../mitchellh/multistep/basic_runner.go | 102 --------------- .../mitchellh/multistep/debug_runner.go | 123 ------------------ .../mitchellh/multistep/multistep.go | 48 ------- .../mitchellh/multistep/statebag.go | 47 ------- vendor/vendor.json | 6 - 7 files changed, 407 deletions(-) delete mode 100644 vendor/github.com/mitchellh/multistep/LICENSE.md delete mode 100644 vendor/github.com/mitchellh/multistep/README.md delete mode 100644 vendor/github.com/mitchellh/multistep/basic_runner.go delete mode 100644 vendor/github.com/mitchellh/multistep/debug_runner.go delete mode 100644 vendor/github.com/mitchellh/multistep/multistep.go delete mode 100644 vendor/github.com/mitchellh/multistep/statebag.go diff --git a/vendor/github.com/mitchellh/multistep/LICENSE.md b/vendor/github.com/mitchellh/multistep/LICENSE.md deleted file mode 100644 index c9d6b768c..000000000 --- a/vendor/github.com/mitchellh/multistep/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Mitchell Hashimoto - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/mitchellh/multistep/README.md b/vendor/github.com/mitchellh/multistep/README.md deleted file mode 100644 index 9ceae012a..000000000 --- a/vendor/github.com/mitchellh/multistep/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# multistep - -multistep is a Go library for building up complex actions using discrete, -individual "steps." These steps are strung together and run in sequence -to achieve a more complex goal. The runner handles cleanup, cancelling, etc. -if necessary. - -## Basic Example - -Make a step to perform some action. The step can access your "state", -which is passed between steps by the runner. - -```go -type stepAdd struct{} - -func (s *stepAdd) Run(state multistep.StateBag) multistep.StepAction { - // Read our value and assert that it is they type we want - value := state.Get("value").(int) - fmt.Printf("Value is %d\n", value) - - // Store some state back - state.Put("value", value + 1) - return multistep.ActionContinue -} - -func (s *stepAdd) Cleanup(multistep.StateBag) { - // This is called after all the steps have run or if the runner is - // cancelled so that cleanup can be performed. -} -``` - -Make a runner and call your array of Steps. - -```go -func main() { - // Our "bag of state" that we read the value from - state := new(multistep.BasicStateBag) - state.Put("value", 0) - - steps := []multistep.Step{ - &stepAdd{}, - &stepAdd{}, - &stepAdd{}, - } - - runner := &multistep.BasicRunner{Steps: steps} - - // Executes the steps - runner.Run(state) -} -``` - -This will produce: - -``` -Value is 0 -Value is 1 -Value is 2 -``` diff --git a/vendor/github.com/mitchellh/multistep/basic_runner.go b/vendor/github.com/mitchellh/multistep/basic_runner.go deleted file mode 100644 index 35692a743..000000000 --- a/vendor/github.com/mitchellh/multistep/basic_runner.go +++ /dev/null @@ -1,102 +0,0 @@ -package multistep - -import ( - "sync" - "sync/atomic" -) - -type runState int32 - -const ( - stateIdle runState = iota - stateRunning - stateCancelling -) - -// BasicRunner is a Runner that just runs the given slice of steps. -type BasicRunner struct { - // Steps is a slice of steps to run. Once set, this should _not_ be - // modified. - Steps []Step - - cancelCh chan struct{} - doneCh chan struct{} - state runState - l sync.Mutex -} - -func (b *BasicRunner) Run(state StateBag) { - b.l.Lock() - if b.state != stateIdle { - panic("already running") - } - - cancelCh := make(chan struct{}) - doneCh := make(chan struct{}) - b.cancelCh = cancelCh - b.doneCh = doneCh - b.state = stateRunning - b.l.Unlock() - - defer func() { - b.l.Lock() - b.cancelCh = nil - b.doneCh = nil - b.state = stateIdle - close(doneCh) - b.l.Unlock() - }() - - // This goroutine listens for cancels and puts the StateCancelled key - // as quickly as possible into the state bag to mark it. - go func() { - select { - case <-cancelCh: - // Flag cancel and wait for finish - state.Put(StateCancelled, true) - <-doneCh - case <-doneCh: - } - }() - - for _, step := range b.Steps { - // We also check for cancellation here since we can't be sure - // the goroutine that is running to set it actually ran. - if runState(atomic.LoadInt32((*int32)(&b.state))) == stateCancelling { - state.Put(StateCancelled, true) - break - } - - action := step.Run(state) - defer step.Cleanup(state) - - if _, ok := state.GetOk(StateCancelled); ok { - break - } - - if action == ActionHalt { - state.Put(StateHalted, true) - break - } - } -} - -func (b *BasicRunner) Cancel() { - b.l.Lock() - switch b.state { - case stateIdle: - // Not running, so Cancel is... done. - b.l.Unlock() - return - case stateRunning: - // Running, so mark that we cancelled and set the state - close(b.cancelCh) - b.state = stateCancelling - fallthrough - case stateCancelling: - // Already cancelling, so just wait until we're done - ch := b.doneCh - b.l.Unlock() - <-ch - } -} diff --git a/vendor/github.com/mitchellh/multistep/debug_runner.go b/vendor/github.com/mitchellh/multistep/debug_runner.go deleted file mode 100644 index 882009494..000000000 --- a/vendor/github.com/mitchellh/multistep/debug_runner.go +++ /dev/null @@ -1,123 +0,0 @@ -package multistep - -import ( - "fmt" - "reflect" - "sync" -) - -// DebugLocation is the location where the pause is occuring when debugging -// a step sequence. "DebugLocationAfterRun" is after the run of the named -// step. "DebugLocationBeforeCleanup" is before the cleanup of the named -// step. -type DebugLocation uint - -const ( - DebugLocationAfterRun DebugLocation = iota - DebugLocationBeforeCleanup -) - -// StepWrapper is an interface that wrapped steps can implement to expose their -// inner step names to the debug runner. -type StepWrapper interface { - // InnerStepName should return the human readable name of the wrapped step. - InnerStepName() string -} - -// DebugPauseFn is the type signature for the function that is called -// whenever the DebugRunner pauses. It allows the caller time to -// inspect the state of the multi-step sequence at a given step. -type DebugPauseFn func(DebugLocation, string, StateBag) - -// DebugRunner is a Runner that runs the given set of steps in order, -// but pauses between each step until it is told to continue. -type DebugRunner struct { - // Steps is the steps to run. These will be run in order. - Steps []Step - - // PauseFn is the function that is called whenever the debug runner - // pauses. The debug runner continues when this function returns. - // The function is given the state so that the state can be inspected. - PauseFn DebugPauseFn - - l sync.Mutex - runner *BasicRunner -} - -func (r *DebugRunner) Run(state StateBag) { - r.l.Lock() - if r.runner != nil { - panic("already running") - } - r.runner = new(BasicRunner) - r.l.Unlock() - - pauseFn := r.PauseFn - - // If no PauseFn is specified, use the default - if pauseFn == nil { - pauseFn = DebugPauseDefault - } - - // Rebuild the steps so that we insert the pause step after each - steps := make([]Step, len(r.Steps)*2) - for i, step := range r.Steps { - steps[i*2] = step - name := "" - if wrapped, ok := step.(StepWrapper); ok { - name = wrapped.InnerStepName() - } else { - name = reflect.Indirect(reflect.ValueOf(step)).Type().Name() - } - steps[(i*2)+1] = &debugStepPause{ - name, - pauseFn, - } - } - - // Then just use a basic runner to run it - r.runner.Steps = steps - r.runner.Run(state) -} - -func (r *DebugRunner) Cancel() { - r.l.Lock() - defer r.l.Unlock() - - if r.runner != nil { - r.runner.Cancel() - } -} - -// DebugPauseDefault is the default pause function when using the -// DebugRunner if no PauseFn is specified. It outputs some information -// to stderr about the step and waits for keyboard input on stdin before -// continuing. -func DebugPauseDefault(loc DebugLocation, name string, state StateBag) { - var locationString string - switch loc { - case DebugLocationAfterRun: - locationString = "after run of" - case DebugLocationBeforeCleanup: - locationString = "before cleanup of" - } - - fmt.Printf("Pausing %s step '%s'. Press any key to continue.\n", locationString, name) - - var line string - fmt.Scanln(&line) -} - -type debugStepPause struct { - StepName string - PauseFn DebugPauseFn -} - -func (s *debugStepPause) Run(state StateBag) StepAction { - s.PauseFn(DebugLocationAfterRun, s.StepName, state) - return ActionContinue -} - -func (s *debugStepPause) Cleanup(state StateBag) { - s.PauseFn(DebugLocationBeforeCleanup, s.StepName, state) -} diff --git a/vendor/github.com/mitchellh/multistep/multistep.go b/vendor/github.com/mitchellh/multistep/multistep.go deleted file mode 100644 index feef1406f..000000000 --- a/vendor/github.com/mitchellh/multistep/multistep.go +++ /dev/null @@ -1,48 +0,0 @@ -// multistep is a library for bulding up complex actions using individual, -// discrete steps. -package multistep - -// A StepAction determines the next step to take regarding multi-step actions. -type StepAction uint - -const ( - ActionContinue StepAction = iota - ActionHalt -) - -// This is the key set in the state bag when using the basic runner to -// signal that the step sequence was cancelled. -const StateCancelled = "cancelled" - -// This is the key set in the state bag when a step halted the sequence. -const StateHalted = "halted" - -// Step is a single step that is part of a potentially large sequence -// of other steps, responsible for performing some specific action. -type Step interface { - // Run is called to perform the action. The parameter is a "state bag" - // of untyped things. Please be very careful about type-checking the - // items in this bag. - // - // The return value determines whether multi-step sequences continue - // or should halt. - Run(StateBag) StepAction - - // Cleanup is called in reverse order of the steps that have run - // and allow steps to clean up after themselves. Do not assume if this - // ran that the entire multi-step sequence completed successfully. This - // method can be ran in the face of errors and cancellations as well. - // - // The parameter is the same "state bag" as Run, and represents the - // state at the latest possible time prior to calling Cleanup. - Cleanup(StateBag) -} - -// Runner is a thing that runs one or more steps. -type Runner interface { - // Run runs the steps with the given initial state. - Run(StateBag) - - // Cancel cancels a potentially running stack of steps. - Cancel() -} diff --git a/vendor/github.com/mitchellh/multistep/statebag.go b/vendor/github.com/mitchellh/multistep/statebag.go deleted file mode 100644 index dab712316..000000000 --- a/vendor/github.com/mitchellh/multistep/statebag.go +++ /dev/null @@ -1,47 +0,0 @@ -package multistep - -import ( - "sync" -) - -// StateBag holds the state that is used by the Runner and Steps. The -// StateBag implementation must be safe for concurrent access. -type StateBag interface { - Get(string) interface{} - GetOk(string) (interface{}, bool) - Put(string, interface{}) -} - -// BasicStateBag implements StateBag by using a normal map underneath -// protected by a RWMutex. -type BasicStateBag struct { - data map[string]interface{} - l sync.RWMutex - once sync.Once -} - -func (b *BasicStateBag) Get(k string) interface{} { - result, _ := b.GetOk(k) - return result -} - -func (b *BasicStateBag) GetOk(k string) (interface{}, bool) { - b.l.RLock() - defer b.l.RUnlock() - - result, ok := b.data[k] - return result, ok -} - -func (b *BasicStateBag) Put(k string, v interface{}) { - b.l.Lock() - defer b.l.Unlock() - - // Make sure the map is initialized one time, on write - b.once.Do(func() { - b.data = make(map[string]interface{}) - }) - - // Write the data - b.data[k] = v -} diff --git a/vendor/vendor.json b/vendor/vendor.json index 1c61745f5..3cf9e6714 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -961,12 +961,6 @@ "path": "github.com/mitchellh/mapstructure", "revision": "281073eb9eb092240d33ef253c404f1cca550309" }, - { - "checksumSHA1": "5x1RX5m8SCkCRLyLL8wBc0qJpV8=", - "path": "github.com/mitchellh/multistep", - "revision": "391576a156a54cfbb4cf5d5eda40cf6ffa3e3a4d", - "revisionTime": "2017-03-16T18:53:39Z" - }, { "checksumSHA1": "m2L8ohfZiFRsMW3iynaH/TWgnSY=", "path": "github.com/mitchellh/panicwrap", From 807e88245b8d2fd6aac8b72333c8fb713e51fe0b Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 17 Jan 2018 22:49:03 -0800 Subject: [PATCH 02/19] trying to add context to state bag --- .../amazon/common/step_run_source_instance.go | 13 +- command/build.go | 3 + helper/multistep/LICENSE.md | 22 +++ helper/multistep/basic_runner.go | 105 +++++++++++ helper/multistep/basic_runner_test.go | 172 +++++++++++++++++ helper/multistep/debug_runner.go | 123 ++++++++++++ helper/multistep/debug_runner_test.go | 176 ++++++++++++++++++ helper/multistep/doc.go | 61 ++++++ helper/multistep/multistep.go | 48 +++++ helper/multistep/multistep_test.go | 75 ++++++++ helper/multistep/statebag.go | 48 +++++ helper/multistep/statebag_test.go | 30 +++ 12 files changed, 875 insertions(+), 1 deletion(-) create mode 100644 helper/multistep/LICENSE.md create mode 100644 helper/multistep/basic_runner.go create mode 100644 helper/multistep/basic_runner_test.go create mode 100644 helper/multistep/debug_runner.go create mode 100644 helper/multistep/debug_runner_test.go create mode 100644 helper/multistep/doc.go create mode 100644 helper/multistep/multistep.go create mode 100644 helper/multistep/multistep_test.go create mode 100644 helper/multistep/statebag.go create mode 100644 helper/multistep/statebag_test.go diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index aba0e9ab5..cf1557c54 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -1,6 +1,7 @@ package common import ( + "context" "encoding/base64" "fmt" "io/ioutil" @@ -178,7 +179,17 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi describeInstance := &ec2.DescribeInstancesInput{ InstanceIds: []*string{aws.String(instanceId)}, } - if err := ec2conn.WaitUntilInstanceRunning(describeInstance); err != nil { + ctx, cancel := context.WithCancel(context.Background()) + + go func() { + for { + if _, ok := state.GetOk(multistep.StateCancelled); ok { + cancel() + } + } + }() + + if err := ec2conn.WaitUntilInstanceRunningWithContext(ctx, describeInstance); err != nil { err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", instanceId, err) state.Put("error", err) ui.Error(err.Error()) diff --git a/command/build.go b/command/build.go index de9da51ee..6f7659821 100644 --- a/command/build.go +++ b/command/build.go @@ -138,9 +138,11 @@ func (c BuildCommand) Run(args []string) int { m map[string][]packer.Artifact }{m: make(map[string][]packer.Artifact)} errors := make(map[string]error) + // ctx := context.Background() for _, b := range builds { // Increment the waitgroup so we wait for this item to finish properly wg.Add(1) + // buildCtx, cancelCtx := ctx.WithCancel() // Handle interrupts for this build sigCh := make(chan os.Signal, 1) @@ -154,6 +156,7 @@ func (c BuildCommand) Run(args []string) int { log.Printf("Stopping build: %s", b.Name()) b.Cancel() + //cancelCtx() log.Printf("Build cancelled: %s", b.Name()) }(b) diff --git a/helper/multistep/LICENSE.md b/helper/multistep/LICENSE.md new file mode 100644 index 000000000..c9d6b768c --- /dev/null +++ b/helper/multistep/LICENSE.md @@ -0,0 +1,22 @@ +Copyright (c) 2013 Mitchell Hashimoto + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go new file mode 100644 index 000000000..305b801dd --- /dev/null +++ b/helper/multistep/basic_runner.go @@ -0,0 +1,105 @@ +package multistep + +import ( + "sync" + "sync/atomic" + + "golang.org/x/net/context" +) + +type runState int32 + +const ( + stateIdle runState = iota + stateRunning + stateCancelling +) + +// BasicRunner is a Runner that just runs the given slice of steps. +type BasicRunner struct { + // Steps is a slice of steps to run. Once set, this should _not_ be + // modified. + Steps []Step + + cancel context.CancelFunc + doneCh chan struct{} + state runState + l sync.Mutex +} + +func (b *BasicRunner) Run(state StateBag) { + ctx, cancel := context.WithCancel(state.Context()) + + b.l.Lock() + if b.state != stateIdle { + panic("already running") + } + + doneCh := make(chan struct{}) + b.cancel = cancel + b.doneCh = doneCh + b.state = stateRunning + b.l.Unlock() + + defer func() { + b.l.Lock() + b.cancel = nil + b.doneCh = nil + b.state = stateIdle + close(doneCh) + b.l.Unlock() + }() + + // This goroutine listens for cancels and puts the StateCancelled key + // as quickly as possible into the state bag to mark it. + go func() { + select { + case <-ctx.Done(): + // Flag cancel and wait for finish + state.Put(StateCancelled, true) + <-doneCh + case <-doneCh: + } + }() + + for _, step := range b.Steps { + // We also check for cancellation here since we can't be sure + // the goroutine that is running to set it actually ran. + if runState(atomic.LoadInt32((*int32)(&b.state))) == stateCancelling { + state.Put(StateCancelled, true) + break + } + + action := step.Run(state) + defer step.Cleanup(state) + + if _, ok := state.GetOk(StateCancelled); ok { + break + } + + if action == ActionHalt { + state.Put(StateHalted, true) + break + } + } +} + +func (b *BasicRunner) Cancel() { + b.l.Lock() + switch b.state { + case stateIdle: + // Not running, so Cancel is... done. + b.l.Unlock() + return + case stateRunning: + // Running, so mark that we cancelled and set the state + b.cancel() + b.state = stateCancelling + fallthrough + case stateCancelling: + // Already cancelling, so just wait until we're done + ch := b.doneCh + b.l.Unlock() + <-ch + } +} diff --git a/helper/multistep/basic_runner_test.go b/helper/multistep/basic_runner_test.go new file mode 100644 index 000000000..d13ccedf0 --- /dev/null +++ b/helper/multistep/basic_runner_test.go @@ -0,0 +1,172 @@ +package multistep + +import ( + "reflect" + "testing" + "time" + + "golang.org/x/net/context" +) + +func TestBasicRunner_ImplRunner(t *testing.T) { + var raw interface{} + raw = &BasicRunner{} + if _, ok := raw.(Runner); !ok { + t.Fatalf("BasicRunner must be a Runner") + } +} + +func TestBasicRunner_Run(t *testing.T) { + data := new(BasicStateBag) + stepA := &TestStepAcc{Data: "a"} + stepB := &TestStepAcc{Data: "b"} + + r := &BasicRunner{Steps: []Step{stepA, stepB}} + r.Run(context.Background(), data) + + // Test run data + expected := []string{"a", "b"} + results := data.Get("data").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test cleanup data + expected = []string{"b", "a"} + results = data.Get("cleanup").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test no halted or cancelled + if _, ok := data.GetOk(StateCancelled); ok { + t.Errorf("cancelled should not be in state bag") + } + + if _, ok := data.GetOk(StateHalted); ok { + t.Errorf("halted should not be in state bag") + } +} + +func TestBasicRunner_Run_Halt(t *testing.T) { + data := new(BasicStateBag) + stepA := &TestStepAcc{Data: "a"} + stepB := &TestStepAcc{Data: "b", Halt: true} + stepC := &TestStepAcc{Data: "c"} + + r := &BasicRunner{Steps: []Step{stepA, stepB, stepC}} + r.Run(context.Background(), data) + + // Test run data + expected := []string{"a", "b"} + results := data.Get("data").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test cleanup data + expected = []string{"b", "a"} + results = data.Get("cleanup").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test that it says it is halted + halted := data.Get(StateHalted).(bool) + if !halted { + t.Errorf("not halted") + } +} + +// confirm that can't run twice +func TestBasicRunner_Run_Run(t *testing.T) { + defer func() { + recover() + }() + ch := make(chan chan bool) + stepInt := &TestStepSync{ch} + stepWait := &TestStepWaitForever{} + r := &BasicRunner{Steps: []Step{stepInt, stepWait}} + + go r.Run(context.Background(), new(BasicStateBag)) + // wait until really running + <-ch + + // now try to run aain + r.Run(context.Background(), new(BasicStateBag)) + + // should not get here in nominal codepath + t.Errorf("Was able to run an already running BasicRunner") +} + +func TestBasicRunner_Cancel(t *testing.T) { + ch := make(chan chan bool) + data := new(BasicStateBag) + stepA := &TestStepAcc{Data: "a"} + stepB := &TestStepAcc{Data: "b"} + stepInt := &TestStepSync{ch} + stepC := &TestStepAcc{Data: "c"} + + r := &BasicRunner{Steps: []Step{stepA, stepB, stepInt, stepC}} + + // cancelling an idle Runner is a no-op + r.Cancel() + + go r.Run(context.Background(), data) + + // Wait until we reach the sync point + responseCh := <-ch + + // Cancel then continue chain + cancelCh := make(chan bool) + go func() { + r.Cancel() + cancelCh <- true + }() + + for { + if _, ok := data.GetOk(StateCancelled); ok { + responseCh <- true + break + } + + time.Sleep(10 * time.Millisecond) + } + + <-cancelCh + + // Test run data + expected := []string{"a", "b"} + results := data.Get("data").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test cleanup data + expected = []string{"b", "a"} + results = data.Get("cleanup").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test that it says it is cancelled + cancelled := data.Get(StateCancelled).(bool) + if !cancelled { + t.Errorf("not cancelled") + } +} + +func TestBasicRunner_Cancel_Special(t *testing.T) { + stepOne := &TestStepInjectCancel{} + stepTwo := &TestStepInjectCancel{} + r := &BasicRunner{Steps: []Step{stepOne, stepTwo}} + + state := new(BasicStateBag) + state.Put("runner", r) + r.Run(context.Background(), state) + + // test that state contains cancelled + if _, ok := state.GetOk(StateCancelled); !ok { + t.Errorf("cancelled should be in state bag") + } +} diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go new file mode 100644 index 000000000..882009494 --- /dev/null +++ b/helper/multistep/debug_runner.go @@ -0,0 +1,123 @@ +package multistep + +import ( + "fmt" + "reflect" + "sync" +) + +// DebugLocation is the location where the pause is occuring when debugging +// a step sequence. "DebugLocationAfterRun" is after the run of the named +// step. "DebugLocationBeforeCleanup" is before the cleanup of the named +// step. +type DebugLocation uint + +const ( + DebugLocationAfterRun DebugLocation = iota + DebugLocationBeforeCleanup +) + +// StepWrapper is an interface that wrapped steps can implement to expose their +// inner step names to the debug runner. +type StepWrapper interface { + // InnerStepName should return the human readable name of the wrapped step. + InnerStepName() string +} + +// DebugPauseFn is the type signature for the function that is called +// whenever the DebugRunner pauses. It allows the caller time to +// inspect the state of the multi-step sequence at a given step. +type DebugPauseFn func(DebugLocation, string, StateBag) + +// DebugRunner is a Runner that runs the given set of steps in order, +// but pauses between each step until it is told to continue. +type DebugRunner struct { + // Steps is the steps to run. These will be run in order. + Steps []Step + + // PauseFn is the function that is called whenever the debug runner + // pauses. The debug runner continues when this function returns. + // The function is given the state so that the state can be inspected. + PauseFn DebugPauseFn + + l sync.Mutex + runner *BasicRunner +} + +func (r *DebugRunner) Run(state StateBag) { + r.l.Lock() + if r.runner != nil { + panic("already running") + } + r.runner = new(BasicRunner) + r.l.Unlock() + + pauseFn := r.PauseFn + + // If no PauseFn is specified, use the default + if pauseFn == nil { + pauseFn = DebugPauseDefault + } + + // Rebuild the steps so that we insert the pause step after each + steps := make([]Step, len(r.Steps)*2) + for i, step := range r.Steps { + steps[i*2] = step + name := "" + if wrapped, ok := step.(StepWrapper); ok { + name = wrapped.InnerStepName() + } else { + name = reflect.Indirect(reflect.ValueOf(step)).Type().Name() + } + steps[(i*2)+1] = &debugStepPause{ + name, + pauseFn, + } + } + + // Then just use a basic runner to run it + r.runner.Steps = steps + r.runner.Run(state) +} + +func (r *DebugRunner) Cancel() { + r.l.Lock() + defer r.l.Unlock() + + if r.runner != nil { + r.runner.Cancel() + } +} + +// DebugPauseDefault is the default pause function when using the +// DebugRunner if no PauseFn is specified. It outputs some information +// to stderr about the step and waits for keyboard input on stdin before +// continuing. +func DebugPauseDefault(loc DebugLocation, name string, state StateBag) { + var locationString string + switch loc { + case DebugLocationAfterRun: + locationString = "after run of" + case DebugLocationBeforeCleanup: + locationString = "before cleanup of" + } + + fmt.Printf("Pausing %s step '%s'. Press any key to continue.\n", locationString, name) + + var line string + fmt.Scanln(&line) +} + +type debugStepPause struct { + StepName string + PauseFn DebugPauseFn +} + +func (s *debugStepPause) Run(state StateBag) StepAction { + s.PauseFn(DebugLocationAfterRun, s.StepName, state) + return ActionContinue +} + +func (s *debugStepPause) Cleanup(state StateBag) { + s.PauseFn(DebugLocationBeforeCleanup, s.StepName, state) +} diff --git a/helper/multistep/debug_runner_test.go b/helper/multistep/debug_runner_test.go new file mode 100644 index 000000000..78ce70a88 --- /dev/null +++ b/helper/multistep/debug_runner_test.go @@ -0,0 +1,176 @@ +package multistep + +import ( + "os" + "reflect" + "testing" + "time" + + "golang.org/x/net/context" +) + +func TestDebugRunner_Impl(t *testing.T) { + var raw interface{} + raw = &DebugRunner{} + if _, ok := raw.(Runner); !ok { + t.Fatal("DebugRunner must be a runner.") + } +} + +func TestDebugRunner_Run(t *testing.T) { + data := new(BasicStateBag) + stepA := &TestStepAcc{Data: "a"} + stepB := &TestStepAcc{Data: "b"} + + pauseFn := func(loc DebugLocation, name string, state StateBag) { + key := "data" + if loc == DebugLocationBeforeCleanup { + key = "cleanup" + } + + if _, ok := state.GetOk(key); !ok { + state.Put(key, make([]string, 0, 5)) + } + + data := state.Get(key).([]string) + state.Put(key, append(data, name)) + } + + r := &DebugRunner{ + Steps: []Step{stepA, stepB}, + PauseFn: pauseFn, + } + + r.Run(context.Background(), data) + + // Test data + expected := []string{"a", "TestStepAcc", "b", "TestStepAcc"} + results := data.Get("data").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected results: %#v", results) + } + + // Test cleanup + expected = []string{"TestStepAcc", "b", "TestStepAcc", "a"} + results = data.Get("cleanup").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected results: %#v", results) + } +} + +// confirm that can't run twice +func TestDebugRunner_Run_Run(t *testing.T) { + defer func() { + recover() + }() + ch := make(chan chan bool) + stepInt := &TestStepSync{ch} + stepWait := &TestStepWaitForever{} + r := &DebugRunner{Steps: []Step{stepInt, stepWait}} + + go r.Run(context.Background(), new(BasicStateBag)) + // wait until really running + <-ch + + // now try to run aain + r.Run(context.Background(), new(BasicStateBag)) + + // should not get here in nominal codepath + t.Errorf("Was able to run an already running DebugRunner") +} + +func TestDebugRunner_Cancel(t *testing.T) { + ch := make(chan chan bool) + data := new(BasicStateBag) + stepA := &TestStepAcc{Data: "a"} + stepB := &TestStepAcc{Data: "b"} + stepInt := &TestStepSync{ch} + stepC := &TestStepAcc{Data: "c"} + + r := &DebugRunner{} + r.Steps = []Step{stepA, stepB, stepInt, stepC} + + // cancelling an idle Runner is a no-op + r.Cancel() + + go r.Run(context.Background(), data) + + // Wait until we reach the sync point + responseCh := <-ch + + // Cancel then continue chain + cancelCh := make(chan bool) + go func() { + r.Cancel() + cancelCh <- true + }() + + for { + if _, ok := data.GetOk(StateCancelled); ok { + responseCh <- true + break + } + + time.Sleep(10 * time.Millisecond) + } + + <-cancelCh + + // Test run data + expected := []string{"a", "b"} + results := data.Get("data").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test cleanup data + expected = []string{"b", "a"} + results = data.Get("cleanup").([]string) + if !reflect.DeepEqual(results, expected) { + t.Errorf("unexpected result: %#v", results) + } + + // Test that it says it is cancelled + cancelled := data.Get(StateCancelled).(bool) + if !cancelled { + t.Errorf("not cancelled") + } +} + +func TestDebugPauseDefault(t *testing.T) { + + // Create a pipe pair so that writes/reads are blocked until we do it + r, w, err := os.Pipe() + if err != nil { + t.Fatalf("err: %s", err) + } + + // Set stdin so we can control it + oldStdin := os.Stdin + os.Stdin = r + defer func() { os.Stdin = oldStdin }() + + // Start pausing + complete := make(chan bool, 1) + go func() { + dr := &DebugRunner{Steps: []Step{ + &TestStepAcc{Data: "a"}, + }} + dr.Run(context.Background(), new(BasicStateBag)) + complete <- true + }() + + select { + case <-complete: + t.Fatal("shouldn't have completed") + case <-time.After(100 * time.Millisecond): + } + + w.Write([]byte("\n\n")) + + select { + case <-complete: + case <-time.After(100 * time.Millisecond): + t.Fatal("didn't complete") + } +} diff --git a/helper/multistep/doc.go b/helper/multistep/doc.go new file mode 100644 index 000000000..17570cda9 --- /dev/null +++ b/helper/multistep/doc.go @@ -0,0 +1,61 @@ +/* +multistep is a Go library for building up complex actions using discrete, +individual "steps." These steps are strung together and run in sequence +to achieve a more complex goal. The runner handles cleanup, cancelling, etc. +if necessary. + +## Basic Example + +Make a step to perform some action. The step can access your "state", +which is passed between steps by the runner. + +```go +type stepAdd struct{} + +func (s *stepAdd) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + // Read our value and assert that it is they type we want + value := state.Get("value").(int) + fmt.Printf("Value is %d\n", value) + + // Store some state back + state.Put("value", value + 1) + return multistep.ActionContinue +} + +func (s *stepAdd) Cleanup(multistep.StateBag) { + // This is called after all the steps have run or if the runner is + // cancelled so that cleanup can be performed. +} +``` + +Make a runner and call your array of Steps. + +```go +func main() { + // Our "bag of state" that we read the value from + state := new(multistep.BasicStateBag) + state.Put("value", 0) + + steps := []multistep.Step{ + &stepAdd{}, + &stepAdd{}, + &stepAdd{}, + } + + runner := &multistep.BasicRunner{Steps: steps} + + // Executes the steps + runner.Run(context.Background(), state) +} +``` + +This will produce: + +``` +Value is 0 +Value is 1 +Value is 2 +``` +*/ + +package multistep diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go new file mode 100644 index 000000000..4e3478dac --- /dev/null +++ b/helper/multistep/multistep.go @@ -0,0 +1,48 @@ +// multistep is a library for building up complex actions using individual, +// discrete steps. +package multistep + +// A StepAction determines the next step to take regarding multi-step actions. +type StepAction uint + +const ( + ActionContinue StepAction = iota + ActionHalt +) + +// This is the key set in the state bag when using the basic runner to +// signal that the step sequence was cancelled. +const StateCancelled = "cancelled" + +// This is the key set in the state bag when a step halted the sequence. +const StateHalted = "halted" + +// Step is a single step that is part of a potentially large sequence +// of other steps, responsible for performing some specific action. +type Step interface { + // Run is called to perform the action. The parameter is a "state bag" + // of untyped things. Please be very careful about type-checking the + // items in this bag. + // + // The return value determines whether multi-step sequences continue + // or should halt. + Run(StateBag) StepAction + + // Cleanup is called in reverse order of the steps that have run + // and allow steps to clean up after themselves. Do not assume if this + // ran that the entire multi-step sequence completed successfully. This + // method can be ran in the face of errors and cancellations as well. + // + // The parameter is the same "state bag" as Run, and represents the + // state at the latest possible time prior to calling Cleanup. + Cleanup(StateBag) +} + +// Runner is a thing that runs one or more steps. +type Runner interface { + // Run runs the steps with the given initial state. + Run(StateBag) + + // Cancel cancels a potentially running stack of steps. + Cancel() +} diff --git a/helper/multistep/multistep_test.go b/helper/multistep/multistep_test.go new file mode 100644 index 000000000..b8e4a0f9e --- /dev/null +++ b/helper/multistep/multistep_test.go @@ -0,0 +1,75 @@ +package multistep + +import "golang.org/x/net/context" + +// A step for testing that accumuluates data into a string slice in the +// the state bag. It always uses the "data" key in the state bag, and will +// initialize it. +type TestStepAcc struct { + // The data inserted into the state bag. + Data string + + // If true, it will halt at the step when it is run + Halt bool +} + +// A step that syncs by sending a channel and expecting a response. +type TestStepSync struct { + Ch chan chan bool +} + +// A step that sleeps forever +type TestStepWaitForever struct { +} + +// A step that manually flips state to cancelling in run +type TestStepInjectCancel struct { +} + +func (s TestStepAcc) Run(_ context.Context, state StateBag) StepAction { + s.insertData(state, "data") + + if s.Halt { + return ActionHalt + } + + return ActionContinue +} + +func (s TestStepAcc) Cleanup(state StateBag) { + s.insertData(state, "cleanup") +} + +func (s TestStepAcc) insertData(state StateBag, key string) { + if _, ok := state.GetOk(key); !ok { + state.Put(key, make([]string, 0, 5)) + } + + data := state.Get(key).([]string) + data = append(data, s.Data) + state.Put(key, data) +} + +func (s TestStepSync) Run(context.Context, StateBag) StepAction { + ch := make(chan bool) + s.Ch <- ch + <-ch + + return ActionContinue +} + +func (s TestStepSync) Cleanup(StateBag) {} + +func (s TestStepWaitForever) Run(context.Context, StateBag) StepAction { + select {} +} + +func (s TestStepWaitForever) Cleanup(StateBag) {} + +func (s TestStepInjectCancel) Run(_ context.Context, state StateBag) StepAction { + r := state.Get("runner").(*BasicRunner) + r.state = stateCancelling + return ActionContinue +} + +func (s TestStepInjectCancel) Cleanup(StateBag) {} diff --git a/helper/multistep/statebag.go b/helper/multistep/statebag.go new file mode 100644 index 000000000..d9f121561 --- /dev/null +++ b/helper/multistep/statebag.go @@ -0,0 +1,48 @@ +package multistep + +import ( + "context" + "sync" +) + +// StateBag implements StateBag by using a normal map underneath +// protected by a RWMutex. +type StateBag struct { + data map[string]interface{} + l sync.RWMutex + once sync.Once + ctx context.Context +} + +func (b *StateBag) Context() context.Context { + if b.ctx != nil { + return b.ctx + } + return context.Background() +} + +func (b *StateBag) Get(k string) interface{} { + result, _ := b.GetOk(k) + return result +} + +func (b *StateBag) GetOk(k string) (interface{}, bool) { + b.l.RLock() + defer b.l.RUnlock() + + result, ok := b.data[k] + return result, ok +} + +func (b *StateBag) Put(k string, v interface{}) { + b.l.Lock() + defer b.l.Unlock() + + // Make sure the map is initialized one time, on write + b.once.Do(func() { + b.data = make(map[string]interface{}) + }) + + // Write the data + b.data[k] = v +} diff --git a/helper/multistep/statebag_test.go b/helper/multistep/statebag_test.go new file mode 100644 index 000000000..1793ee6e2 --- /dev/null +++ b/helper/multistep/statebag_test.go @@ -0,0 +1,30 @@ +package multistep + +import ( + "testing" +) + +func TestBasicStateBag_ImplRunner(t *testing.T) { + var raw interface{} + raw = &BasicStateBag{} + if _, ok := raw.(StateBag); !ok { + t.Fatalf("must be a StateBag") + } +} + +func TestBasicStateBag(t *testing.T) { + b := new(BasicStateBag) + if b.Get("foo") != nil { + t.Fatalf("bad: %#v", b.Get("foo")) + } + + if _, ok := b.GetOk("foo"); ok { + t.Fatal("should not have foo") + } + + b.Put("foo", "bar") + + if b.Get("foo").(string) != "bar" { + t.Fatalf("bad") + } +} From 89d43256bb28fc91c2154e95330a8ac3207ee9f9 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 15:59:33 -0800 Subject: [PATCH 03/19] pass context into step.run --- helper/multistep/basic_runner.go | 4 ++-- helper/multistep/debug_runner.go | 3 ++- helper/multistep/multistep.go | 4 +++- helper/multistep/statebag.go | 27 +++++++++++++-------------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index 305b801dd..eb5018d36 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -28,7 +28,7 @@ type BasicRunner struct { } func (b *BasicRunner) Run(state StateBag) { - ctx, cancel := context.WithCancel(state.Context()) + ctx, cancel := context.WithCancel(context.Background()) b.l.Lock() if b.state != stateIdle { @@ -70,7 +70,7 @@ func (b *BasicRunner) Run(state StateBag) { break } - action := step.Run(state) + action := step.Run(ctx, state) defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 882009494..88af01c54 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,6 +1,7 @@ package multistep import ( + "context" "fmt" "reflect" "sync" @@ -113,7 +114,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(state StateBag) StepAction { +func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 4e3478dac..7b4e0801f 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -2,6 +2,8 @@ // discrete steps. package multistep +import "context" + // A StepAction determines the next step to take regarding multi-step actions. type StepAction uint @@ -26,7 +28,7 @@ type Step interface { // // The return value determines whether multi-step sequences continue // or should halt. - Run(StateBag) StepAction + Run(context.Context, StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this diff --git a/helper/multistep/statebag.go b/helper/multistep/statebag.go index d9f121561..dab712316 100644 --- a/helper/multistep/statebag.go +++ b/helper/multistep/statebag.go @@ -1,32 +1,31 @@ package multistep import ( - "context" "sync" ) -// StateBag implements StateBag by using a normal map underneath +// StateBag holds the state that is used by the Runner and Steps. The +// StateBag implementation must be safe for concurrent access. +type StateBag interface { + Get(string) interface{} + GetOk(string) (interface{}, bool) + Put(string, interface{}) +} + +// BasicStateBag implements StateBag by using a normal map underneath // protected by a RWMutex. -type StateBag struct { +type BasicStateBag struct { data map[string]interface{} l sync.RWMutex once sync.Once - ctx context.Context } -func (b *StateBag) Context() context.Context { - if b.ctx != nil { - return b.ctx - } - return context.Background() -} - -func (b *StateBag) Get(k string) interface{} { +func (b *BasicStateBag) Get(k string) interface{} { result, _ := b.GetOk(k) return result } -func (b *StateBag) GetOk(k string) (interface{}, bool) { +func (b *BasicStateBag) GetOk(k string) (interface{}, bool) { b.l.RLock() defer b.l.RUnlock() @@ -34,7 +33,7 @@ func (b *StateBag) GetOk(k string) (interface{}, bool) { return result, ok } -func (b *StateBag) Put(k string, v interface{}) { +func (b *BasicStateBag) Put(k string, v interface{}) { b.l.Lock() defer b.l.Unlock() From 366dc3da0a63b87c7b9a0e56d9c80ef2a25e782e Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 16:18:44 -0800 Subject: [PATCH 04/19] move multistep imports to helper. gomvpkg -from "github.com/mitchellh/multistep" -to "github.com/hashicorp/packer/helper/multistep" --- builder/alicloud/ecs/builder.go | 2 +- builder/alicloud/ecs/packer_helper.go | 2 +- builder/alicloud/ecs/ssh_helper.go | 2 +- builder/alicloud/ecs/step_attach_keypair.go | 3 ++- builder/alicloud/ecs/step_check_source_image.go | 2 +- builder/alicloud/ecs/step_config_eip.go | 2 +- builder/alicloud/ecs/step_config_key_pair.go | 2 +- builder/alicloud/ecs/step_config_public_ip.go | 2 +- builder/alicloud/ecs/step_config_security_group.go | 2 +- builder/alicloud/ecs/step_config_vpc.go | 2 +- builder/alicloud/ecs/step_config_vswitch.go | 2 +- builder/alicloud/ecs/step_create_image.go | 2 +- builder/alicloud/ecs/step_create_instance.go | 2 +- builder/alicloud/ecs/step_delete_images_snapshots.go | 2 +- builder/alicloud/ecs/step_mount_disk.go | 2 +- builder/alicloud/ecs/step_pre_validate.go | 2 +- builder/alicloud/ecs/step_region_copy_image.go | 2 +- builder/alicloud/ecs/step_run_instance.go | 2 +- builder/alicloud/ecs/step_share_image.go | 2 +- builder/alicloud/ecs/step_stop_instance.go | 2 +- builder/amazon/chroot/builder.go | 2 +- builder/amazon/chroot/cleanup.go | 2 +- builder/amazon/chroot/step_attach_volume.go | 2 +- builder/amazon/chroot/step_check_root_device.go | 2 +- builder/amazon/chroot/step_chroot_provision.go | 2 +- builder/amazon/chroot/step_copy_files.go | 2 ++ builder/amazon/chroot/step_create_volume.go | 2 +- builder/amazon/chroot/step_early_cleanup.go | 5 ++--- builder/amazon/chroot/step_early_unflock.go | 5 ++--- builder/amazon/chroot/step_flock.go | 2 ++ builder/amazon/chroot/step_instance_info.go | 2 +- builder/amazon/chroot/step_mount_device.go | 2 +- builder/amazon/chroot/step_mount_extra.go | 2 ++ builder/amazon/chroot/step_post_mount_commands.go | 2 +- builder/amazon/chroot/step_pre_mount_commands.go | 2 +- builder/amazon/chroot/step_prepare_device.go | 2 +- builder/amazon/chroot/step_register_ami.go | 2 +- builder/amazon/chroot/step_snapshot.go | 2 +- builder/amazon/common/ssh.go | 2 +- builder/amazon/common/ssh_test.go | 2 +- builder/amazon/common/state.go | 2 +- builder/amazon/common/step_ami_region_copy.go | 2 +- builder/amazon/common/step_create_tags.go | 2 +- builder/amazon/common/step_deregister_ami.go | 2 +- builder/amazon/common/step_encrypted_ami.go | 2 +- builder/amazon/common/step_get_password.go | 2 +- builder/amazon/common/step_key_pair.go | 2 +- builder/amazon/common/step_modify_ami_attributes.go | 2 +- builder/amazon/common/step_modify_ebs_instance.go | 2 +- builder/amazon/common/step_pre_validate.go | 2 +- builder/amazon/common/step_run_source_instance.go | 2 +- builder/amazon/common/step_run_spot_instance.go | 2 +- builder/amazon/common/step_security_group.go | 2 +- builder/amazon/common/step_source_ami_info.go | 2 +- builder/amazon/common/step_stop_ebs_instance.go | 2 +- builder/amazon/ebs/builder.go | 2 +- builder/amazon/ebs/step_cleanup_volumes.go | 2 +- builder/amazon/ebs/step_create_ami.go | 2 +- builder/amazon/ebssurrogate/builder.go | 2 +- builder/amazon/ebssurrogate/step_register_ami.go | 2 +- builder/amazon/ebssurrogate/step_snapshot_new_root.go | 2 +- builder/amazon/ebsvolume/builder.go | 2 +- builder/amazon/ebsvolume/step_tag_ebs_volumes.go | 2 +- builder/amazon/instance/builder.go | 2 +- builder/amazon/instance/step_bundle_volume.go | 2 +- builder/amazon/instance/step_register_ami.go | 2 +- builder/amazon/instance/step_upload_bundle.go | 2 +- builder/amazon/instance/step_upload_x509_cert.go | 5 ++--- builder/azure/arm/builder.go | 2 +- builder/azure/arm/step.go | 2 +- builder/azure/arm/step_capture_image.go | 2 +- builder/azure/arm/step_capture_image_test.go | 2 +- builder/azure/arm/step_create_resource_group.go | 2 +- builder/azure/arm/step_create_resource_group_test.go | 2 +- builder/azure/arm/step_delete_os_disk.go | 2 +- builder/azure/arm/step_delete_os_disk_test.go | 2 +- builder/azure/arm/step_delete_resource_group.go | 2 +- builder/azure/arm/step_delete_resource_group_test.go | 2 +- builder/azure/arm/step_deploy_template.go | 2 +- builder/azure/arm/step_deploy_template_test.go | 2 +- builder/azure/arm/step_get_certificate.go | 2 +- builder/azure/arm/step_get_certificate_test.go | 2 +- builder/azure/arm/step_get_ip_address.go | 2 +- builder/azure/arm/step_get_ip_address_test.go | 2 +- builder/azure/arm/step_get_os_disk.go | 2 +- builder/azure/arm/step_get_os_disk_test.go | 2 +- builder/azure/arm/step_power_off_compute.go | 2 +- builder/azure/arm/step_power_off_compute_test.go | 2 +- builder/azure/arm/step_set_certificate.go | 2 +- builder/azure/arm/step_set_certificate_test.go | 2 +- builder/azure/arm/step_test.go | 3 ++- builder/azure/arm/step_validate_template.go | 2 +- builder/azure/arm/step_validate_template_test.go | 2 +- builder/azure/common/lin/ssh.go | 2 +- builder/azure/common/lin/step_create_cert.go | 2 +- builder/azure/common/lin/step_generalize_os.go | 5 ++--- builder/azure/common/state_bag.go | 2 +- builder/cloudstack/builder.go | 2 +- builder/cloudstack/ssh.go | 2 +- builder/cloudstack/step_configure_networking.go | 2 +- builder/cloudstack/step_create_instance.go | 2 +- builder/cloudstack/step_create_security_group.go | 2 +- builder/cloudstack/step_create_template.go | 2 +- builder/cloudstack/step_keypair.go | 2 +- builder/cloudstack/step_prepare_config.go | 2 +- builder/cloudstack/step_shutdown_instance.go | 2 +- builder/digitalocean/builder.go | 2 +- builder/digitalocean/ssh.go | 2 +- builder/digitalocean/step_create_droplet.go | 2 +- builder/digitalocean/step_create_ssh_key.go | 2 +- builder/digitalocean/step_droplet_info.go | 2 +- builder/digitalocean/step_power_off.go | 2 +- builder/digitalocean/step_shutdown.go | 2 +- builder/digitalocean/step_snapshot.go | 2 +- builder/docker/builder.go | 2 +- builder/docker/comm.go | 2 +- builder/docker/step_commit.go | 3 +-- builder/docker/step_commit_test.go | 1 + builder/docker/step_connect_docker.go | 1 + builder/docker/step_export.go | 2 +- builder/docker/step_export_test.go | 1 + builder/docker/step_pull.go | 2 +- builder/docker/step_pull_test.go | 1 + builder/docker/step_run.go | 3 +-- builder/docker/step_run_test.go | 1 + builder/docker/step_temp_dir.go | 2 ++ builder/docker/step_temp_dir_test.go | 2 +- builder/docker/step_test.go | 5 ++--- builder/file/builder.go | 2 +- builder/googlecompute/builder.go | 2 +- builder/googlecompute/ssh.go | 2 +- builder/googlecompute/step_check_existing_image.go | 2 +- builder/googlecompute/step_check_existing_image_test.go | 1 + builder/googlecompute/step_create_image.go | 2 +- builder/googlecompute/step_create_image_test.go | 2 +- builder/googlecompute/step_create_instance.go | 2 +- builder/googlecompute/step_create_instance_test.go | 2 +- builder/googlecompute/step_create_ssh_key.go | 2 +- builder/googlecompute/step_create_ssh_key_test.go | 2 +- builder/googlecompute/step_create_windows_password.go | 2 +- builder/googlecompute/step_create_windows_password_test.go | 2 +- builder/googlecompute/step_instance_info.go | 2 +- builder/googlecompute/step_instance_info_test.go | 1 + builder/googlecompute/step_teardown_instance.go | 2 +- builder/googlecompute/step_teardown_instance_test.go | 1 + builder/googlecompute/step_test.go | 2 +- builder/googlecompute/step_wait_startup_script.go | 2 +- builder/googlecompute/step_wait_startup_script_test.go | 4 +--- builder/googlecompute/winrm.go | 2 +- builder/hyperv/common/ssh.go | 2 +- builder/hyperv/common/step_clone_vm.go | 2 +- builder/hyperv/common/step_configure_ip.go | 2 +- builder/hyperv/common/step_configure_vlan.go | 2 +- builder/hyperv/common/step_create_external_switch.go | 2 +- builder/hyperv/common/step_create_switch.go | 3 +-- builder/hyperv/common/step_create_tempdir.go | 2 +- builder/hyperv/common/step_create_vm.go | 2 +- builder/hyperv/common/step_disable_vlan.go | 3 +-- builder/hyperv/common/step_enable_integration_service.go | 3 +-- builder/hyperv/common/step_export_vm.go | 2 +- builder/hyperv/common/step_mount_dvddrive.go | 2 ++ builder/hyperv/common/step_mount_floppydrive.go | 2 ++ builder/hyperv/common/step_mount_guest_additions.go | 5 ++--- builder/hyperv/common/step_mount_secondary_dvd_images.go | 5 ++--- builder/hyperv/common/step_output_dir.go | 2 +- builder/hyperv/common/step_polling_installation.go | 2 +- builder/hyperv/common/step_reboot_vm.go | 5 ++--- builder/hyperv/common/step_run.go | 5 ++--- builder/hyperv/common/step_shutdown.go | 2 +- builder/hyperv/common/step_sleep.go | 5 ++--- builder/hyperv/common/step_type_boot_command.go | 2 +- builder/hyperv/common/step_unmount_dvddrive.go | 3 +-- builder/hyperv/common/step_unmount_floppydrive.go | 3 +-- builder/hyperv/common/step_unmount_guest_additions.go | 3 +-- builder/hyperv/common/step_unmount_secondary_dvd_images.go | 3 +-- builder/hyperv/common/step_wait_for_install_to_complete.go | 5 ++--- builder/hyperv/iso/builder.go | 2 +- builder/hyperv/iso/builder_test.go | 3 ++- builder/hyperv/vmcx/builder.go | 2 +- builder/hyperv/vmcx/builder_test.go | 4 +++- builder/lxc/builder.go | 5 ++++- builder/lxc/step_export.go | 2 ++ builder/lxc/step_lxc_create.go | 2 ++ builder/lxc/step_prepare_output_dir.go | 2 ++ builder/lxc/step_provision.go | 5 ++--- builder/lxc/step_wait_init.go | 2 ++ builder/lxd/builder.go | 3 ++- builder/lxd/step_lxd_launch.go | 5 ++--- builder/lxd/step_provision.go | 5 ++--- builder/lxd/step_publish.go | 5 ++--- builder/null/builder.go | 2 +- builder/null/ssh.go | 2 +- builder/oneandone/builder.go | 3 ++- builder/oneandone/ssh.go | 2 +- builder/oneandone/step_create_server.go | 4 +++- builder/oneandone/step_create_sshkey.go | 4 +--- builder/oneandone/step_take_snapshot.go | 2 +- builder/openstack/builder.go | 2 +- builder/openstack/server.go | 2 +- builder/openstack/ssh.go | 2 +- builder/openstack/step_add_image_members.go | 2 +- builder/openstack/step_allocate_ip.go | 2 +- builder/openstack/step_create_image.go | 2 +- builder/openstack/step_get_password.go | 2 +- builder/openstack/step_key_pair.go | 2 +- builder/openstack/step_load_extensions.go | 2 +- builder/openstack/step_load_flavor.go | 2 +- builder/openstack/step_run_source_server.go | 2 +- builder/openstack/step_stop_server.go | 2 +- builder/openstack/step_update_image_visibility.go | 2 +- builder/openstack/step_wait_for_rackconnect.go | 2 +- builder/oracle/oci/builder.go | 2 +- builder/oracle/oci/ssh.go | 2 +- builder/oracle/oci/step_create_instance.go | 2 +- builder/oracle/oci/step_create_instance_test.go | 2 +- builder/oracle/oci/step_image.go | 2 +- builder/oracle/oci/step_image_test.go | 2 +- builder/oracle/oci/step_instance_info.go | 2 +- builder/oracle/oci/step_instance_info_test.go | 2 +- builder/oracle/oci/step_ssh_key_pair.go | 2 +- builder/oracle/oci/step_test.go | 2 +- builder/parallels/common/ssh.go | 2 +- builder/parallels/common/step_attach_floppy.go | 2 +- builder/parallels/common/step_attach_floppy_test.go | 2 +- builder/parallels/common/step_attach_parallels_tools.go | 2 +- builder/parallels/common/step_compact_disk.go | 2 +- builder/parallels/common/step_compact_disk_test.go | 2 +- builder/parallels/common/step_output_dir.go | 2 +- builder/parallels/common/step_output_dir_test.go | 2 +- builder/parallels/common/step_prepare_parallels_tools.go | 2 +- .../parallels/common/step_prepare_parallels_tools_test.go | 2 +- builder/parallels/common/step_prlctl.go | 2 +- builder/parallels/common/step_run.go | 2 +- builder/parallels/common/step_shutdown.go | 2 +- builder/parallels/common/step_shutdown_test.go | 2 +- builder/parallels/common/step_test.go | 2 +- builder/parallels/common/step_type_boot_command.go | 2 +- builder/parallels/common/step_type_boot_command_test.go | 2 +- builder/parallels/common/step_upload_parallels_tools.go | 2 +- builder/parallels/common/step_upload_parallels_tools_test.go | 2 +- builder/parallels/common/step_upload_version.go | 2 +- builder/parallels/common/step_upload_version_test.go | 2 +- builder/parallels/iso/builder.go | 2 +- builder/parallels/iso/step_attach_iso.go | 2 +- builder/parallels/iso/step_create_disk.go | 2 +- builder/parallels/iso/step_create_vm.go | 2 +- builder/parallels/iso/step_set_boot_order.go | 2 +- builder/parallels/pvm/builder.go | 2 +- builder/parallels/pvm/step_import.go | 2 +- builder/parallels/pvm/step_test.go | 2 +- builder/profitbricks/builder.go | 3 ++- builder/profitbricks/ssh.go | 2 +- builder/profitbricks/step_create_server.go | 2 +- builder/profitbricks/step_create_ssh_key.go | 4 +--- builder/profitbricks/step_take_snapshot.go | 2 +- builder/qemu/builder.go | 2 +- builder/qemu/driver.go | 2 +- builder/qemu/ssh.go | 2 +- builder/qemu/step_boot_wait.go | 5 ++--- builder/qemu/step_configure_vnc.go | 2 +- builder/qemu/step_convert_disk.go | 2 +- builder/qemu/step_copy_disk.go | 2 +- builder/qemu/step_create_disk.go | 2 +- builder/qemu/step_forward_ssh.go | 2 +- builder/qemu/step_prepare_output_dir.go | 2 ++ builder/qemu/step_resize_disk.go | 2 +- builder/qemu/step_run.go | 2 +- builder/qemu/step_set_iso.go | 2 +- builder/qemu/step_shutdown.go | 2 +- builder/qemu/step_type_boot_command.go | 3 ++- builder/triton/builder.go | 2 +- builder/triton/ssh.go | 2 +- builder/triton/step_create_image_from_machine.go | 2 +- builder/triton/step_create_image_from_machine_test.go | 2 +- builder/triton/step_create_source_machine.go | 2 +- builder/triton/step_create_source_machine_test.go | 2 +- builder/triton/step_delete_machine.go | 2 +- builder/triton/step_delete_machine_test.go | 2 +- builder/triton/step_stop_machine.go | 2 +- builder/triton/step_stop_machine_test.go | 2 +- builder/triton/step_test.go | 5 ++--- builder/triton/step_wait_for_stop_to_not_fail.go | 2 +- builder/virtualbox/common/ssh.go | 2 +- builder/virtualbox/common/step_attach_floppy.go | 2 ++ builder/virtualbox/common/step_attach_floppy_test.go | 1 + builder/virtualbox/common/step_attach_guest_additions.go | 5 ++--- builder/virtualbox/common/step_configure_vrdp.go | 2 +- builder/virtualbox/common/step_download_guest_additions.go | 2 +- builder/virtualbox/common/step_export.go | 2 ++ builder/virtualbox/common/step_export_test.go | 1 + builder/virtualbox/common/step_forward_ssh.go | 2 +- builder/virtualbox/common/step_output_dir.go | 2 +- builder/virtualbox/common/step_output_dir_test.go | 1 + builder/virtualbox/common/step_remove_devices.go | 2 +- builder/virtualbox/common/step_remove_devices_test.go | 1 + builder/virtualbox/common/step_run.go | 2 +- builder/virtualbox/common/step_shutdown.go | 2 ++ builder/virtualbox/common/step_shutdown_test.go | 2 ++ builder/virtualbox/common/step_suppress_messages.go | 5 ++--- builder/virtualbox/common/step_suppress_messages_test.go | 1 + builder/virtualbox/common/step_test.go | 5 ++--- builder/virtualbox/common/step_type_boot_command.go | 2 +- builder/virtualbox/common/step_upload_guest_additions.go | 2 +- builder/virtualbox/common/step_upload_version.go | 5 ++--- builder/virtualbox/common/step_upload_version_test.go | 5 ++--- builder/virtualbox/common/step_vboxmanage.go | 2 +- builder/virtualbox/iso/builder.go | 2 +- builder/virtualbox/iso/step_attach_iso.go | 2 +- builder/virtualbox/iso/step_create_disk.go | 2 +- builder/virtualbox/iso/step_create_vm.go | 2 +- builder/virtualbox/ovf/builder.go | 2 +- builder/virtualbox/ovf/step_import.go | 2 +- builder/virtualbox/ovf/step_import_test.go | 3 ++- builder/virtualbox/ovf/step_test.go | 3 ++- builder/vmware/common/driver.go | 2 +- builder/vmware/common/driver_fusion5.go | 2 +- builder/vmware/common/driver_mock.go | 2 +- builder/vmware/common/driver_player5.go | 2 +- builder/vmware/common/driver_workstation9.go | 2 +- builder/vmware/common/ssh.go | 2 +- builder/vmware/common/step_clean_files.go | 2 ++ builder/vmware/common/step_clean_vmx.go | 2 +- builder/vmware/common/step_clean_vmx_test.go | 2 +- builder/vmware/common/step_compact_disk.go | 5 ++--- builder/vmware/common/step_compact_disk_test.go | 2 +- builder/vmware/common/step_configure_vmx.go | 2 +- builder/vmware/common/step_configure_vmx_test.go | 2 +- builder/vmware/common/step_configure_vnc.go | 2 +- builder/vmware/common/step_output_dir.go | 2 +- builder/vmware/common/step_output_dir_test.go | 1 + builder/vmware/common/step_prepare_tools.go | 2 +- builder/vmware/common/step_prepare_tools_test.go | 2 +- builder/vmware/common/step_run.go | 2 +- builder/vmware/common/step_run_test.go | 2 +- builder/vmware/common/step_shutdown.go | 2 ++ builder/vmware/common/step_shutdown_test.go | 2 +- builder/vmware/common/step_suppress_messages.go | 5 ++--- builder/vmware/common/step_suppress_messages_test.go | 2 +- builder/vmware/common/step_test.go | 5 ++--- builder/vmware/common/step_type_boot_command.go | 2 +- builder/vmware/common/step_upload_tools.go | 2 +- builder/vmware/iso/builder.go | 2 +- builder/vmware/iso/driver_esx5.go | 2 +- builder/vmware/iso/driver_esx5_test.go | 2 +- builder/vmware/iso/step_create_disk.go | 3 ++- builder/vmware/iso/step_create_vmx.go | 2 +- builder/vmware/iso/step_export.go | 2 +- builder/vmware/iso/step_export_test.go | 1 + builder/vmware/iso/step_register.go | 2 +- builder/vmware/iso/step_register_test.go | 1 + builder/vmware/iso/step_remote_upload.go | 3 ++- builder/vmware/iso/step_test.go | 3 ++- builder/vmware/iso/step_upload_vmx.go | 3 ++- builder/vmware/vmx/builder.go | 2 +- builder/vmware/vmx/step_clone_vmx.go | 2 +- builder/vmware/vmx/step_clone_vmx_test.go | 2 +- builder/vmware/vmx/step_test.go | 2 +- common/multistep_debug.go | 2 ++ common/multistep_runner.go | 2 +- common/step_create_floppy.go | 2 +- common/step_create_floppy_test.go | 2 ++ common/step_download.go | 2 +- common/step_download_test.go | 1 + common/step_http_server.go | 2 +- common/step_provision.go | 2 ++ common/step_provision_test.go | 1 + helper/communicator/step_connect.go | 2 +- helper/communicator/step_connect_ssh.go | 2 +- helper/communicator/step_connect_test.go | 2 +- helper/communicator/step_connect_winrm.go | 2 +- post-processor/googlecompute-export/post-processor.go | 2 +- post-processor/vagrant-cloud/post-processor.go | 2 +- post-processor/vagrant-cloud/step_create_provider.go | 3 +-- post-processor/vagrant-cloud/step_create_version.go | 3 +-- post-processor/vagrant-cloud/step_prepare_upload.go | 2 +- post-processor/vagrant-cloud/step_release_version.go | 2 +- post-processor/vagrant-cloud/step_upload.go | 2 +- post-processor/vagrant-cloud/step_verify_box.go | 3 +-- post-processor/vsphere-template/post-processor.go | 2 +- post-processor/vsphere-template/step_choose_datacenter.go | 2 +- post-processor/vsphere-template/step_create_folder.go | 2 +- post-processor/vsphere-template/step_mark_as_template.go | 2 +- 382 files changed, 447 insertions(+), 412 deletions(-) diff --git a/builder/alicloud/ecs/builder.go b/builder/alicloud/ecs/builder.go index 5f7973723..08a7dad08 100644 --- a/builder/alicloud/ecs/builder.go +++ b/builder/alicloud/ecs/builder.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // The unique ID for this builder diff --git a/builder/alicloud/ecs/packer_helper.go b/builder/alicloud/ecs/packer_helper.go index 2486b81cf..15f257381 100644 --- a/builder/alicloud/ecs/packer_helper.go +++ b/builder/alicloud/ecs/packer_helper.go @@ -3,8 +3,8 @@ package ecs import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func message(state multistep.StateBag, module string) { diff --git a/builder/alicloud/ecs/ssh_helper.go b/builder/alicloud/ecs/ssh_helper.go index e08b3afff..aac733ece 100644 --- a/builder/alicloud/ecs/ssh_helper.go +++ b/builder/alicloud/ecs/ssh_helper.go @@ -7,7 +7,7 @@ import ( "time" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/alicloud/ecs/step_attach_keypair.go b/builder/alicloud/ecs/step_attach_keypair.go index b28de52b9..012efd2b1 100644 --- a/builder/alicloud/ecs/step_attach_keypair.go +++ b/builder/alicloud/ecs/step_attach_keypair.go @@ -7,8 +7,9 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) type stepAttachKeyPar struct { diff --git a/builder/alicloud/ecs/step_check_source_image.go b/builder/alicloud/ecs/step_check_source_image.go index 4990f99d5..3f3ee87d0 100644 --- a/builder/alicloud/ecs/step_check_source_image.go +++ b/builder/alicloud/ecs/step_check_source_image.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCheckAlicloudSourceImage struct { diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index b0845ba2a..2d626bf62 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type setpConfigAlicloudEIP struct { diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index 22ccd28b6..62fb41a9d 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -8,8 +8,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepConfigAlicloudKeyPair struct { diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index 65b7f3fe2..c8859afa3 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepConfigAlicloudPublicIP struct { diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index dc8c083b2..8a20915d4 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -7,8 +7,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepConfigAlicloudSecurityGroup struct { diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index c4bdd59a3..c03ed3944 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -7,8 +7,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepConfigAlicloudVPC struct { diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index dfa858d0b..357e40624 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -7,8 +7,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepConfigAlicloudVSwitch struct { diff --git a/builder/alicloud/ecs/step_create_image.go b/builder/alicloud/ecs/step_create_image.go index 5060c78ca..852376250 100644 --- a/builder/alicloud/ecs/step_create_image.go +++ b/builder/alicloud/ecs/step_create_image.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateAlicloudImage struct { diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index c4f33f19c..b2019ade6 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -7,8 +7,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateAlicloudInstance struct { diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index 24104fef0..841190934 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -6,8 +6,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepDeleteAlicloudImageSnapshots struct { diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go index 222b27f08..8ec517ece 100644 --- a/builder/alicloud/ecs/step_mount_disk.go +++ b/builder/alicloud/ecs/step_mount_disk.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepMountAlicloudDisk struct { diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index 527d84fbf..fb4a663f5 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepPreValidate struct { diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index f92878712..c7b68f697 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type setpRegionCopyAlicloudImage struct { diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index a92637648..f8e0f6b68 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepRunAlicloudInstance struct { diff --git a/builder/alicloud/ecs/step_share_image.go b/builder/alicloud/ecs/step_share_image.go index 50e5a640f..7a95fdfd6 100644 --- a/builder/alicloud/ecs/step_share_image.go +++ b/builder/alicloud/ecs/step_share_image.go @@ -5,8 +5,8 @@ import ( "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type setpShareAlicloudImage struct { diff --git a/builder/alicloud/ecs/step_stop_instance.go b/builder/alicloud/ecs/step_stop_instance.go index b12a74c63..4a55c3aba 100644 --- a/builder/alicloud/ecs/step_stop_instance.go +++ b/builder/alicloud/ecs/step_stop_instance.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/denverdino/aliyungo/ecs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepStopAlicloudInstance struct { diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 80d6ae1b9..607ad06a9 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -13,9 +13,9 @@ import ( awscommon "github.com/hashicorp/packer/builder/amazon/common" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // The unique ID for this builder diff --git a/builder/amazon/chroot/cleanup.go b/builder/amazon/chroot/cleanup.go index 0be3bef3f..0befac174 100644 --- a/builder/amazon/chroot/cleanup.go +++ b/builder/amazon/chroot/cleanup.go @@ -1,7 +1,7 @@ package chroot import ( - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // Cleanup is an interface that some steps implement for early cleanup. diff --git a/builder/amazon/chroot/step_attach_volume.go b/builder/amazon/chroot/step_attach_volume.go index 6b83f440b..47fac4d57 100644 --- a/builder/amazon/chroot/step_attach_volume.go +++ b/builder/amazon/chroot/step_attach_volume.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepAttachVolume attaches the previously created volume to an diff --git a/builder/amazon/chroot/step_check_root_device.go b/builder/amazon/chroot/step_check_root_device.go index fa0097aa4..241a46cc1 100644 --- a/builder/amazon/chroot/step_check_root_device.go +++ b/builder/amazon/chroot/step_check_root_device.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCheckRootDevice makes sure the root device on the AMI is EBS-backed. diff --git a/builder/amazon/chroot/step_chroot_provision.go b/builder/amazon/chroot/step_chroot_provision.go index 941e071b1..eb651d78c 100644 --- a/builder/amazon/chroot/step_chroot_provision.go +++ b/builder/amazon/chroot/step_chroot_provision.go @@ -3,8 +3,8 @@ package chroot import ( "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepChrootProvision provisions the instance within a chroot. diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go index e5c8e2215..d608141da 100644 --- a/builder/amazon/chroot/step_copy_files.go +++ b/builder/amazon/chroot/step_copy_files.go @@ -3,6 +3,8 @@ package chroot import ( "bytes" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "path/filepath" diff --git a/builder/amazon/chroot/step_create_volume.go b/builder/amazon/chroot/step_create_volume.go index c1ecbf1a9..ce4b01e64 100644 --- a/builder/amazon/chroot/step_create_volume.go +++ b/builder/amazon/chroot/step_create_volume.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateVolume creates a new volume from the snapshot of the root diff --git a/builder/amazon/chroot/step_early_cleanup.go b/builder/amazon/chroot/step_early_cleanup.go index ebbf3a0ed..c3aecc85c 100644 --- a/builder/amazon/chroot/step_early_cleanup.go +++ b/builder/amazon/chroot/step_early_cleanup.go @@ -2,10 +2,9 @@ package chroot import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // StepEarlyCleanup performs some of the cleanup steps early in order to diff --git a/builder/amazon/chroot/step_early_unflock.go b/builder/amazon/chroot/step_early_unflock.go index b1399c167..92eff391c 100644 --- a/builder/amazon/chroot/step_early_unflock.go +++ b/builder/amazon/chroot/step_early_unflock.go @@ -2,10 +2,9 @@ package chroot import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // StepEarlyUnflock unlocks the flock. diff --git a/builder/amazon/chroot/step_flock.go b/builder/amazon/chroot/step_flock.go index 711b2581e..4b6dd284e 100644 --- a/builder/amazon/chroot/step_flock.go +++ b/builder/amazon/chroot/step_flock.go @@ -2,6 +2,8 @@ package chroot import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "os" "path/filepath" diff --git a/builder/amazon/chroot/step_instance_info.go b/builder/amazon/chroot/step_instance_info.go index 652808952..307e24aa8 100644 --- a/builder/amazon/chroot/step_instance_info.go +++ b/builder/amazon/chroot/step_instance_info.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepInstanceInfo verifies that this builder is running on an EC2 instance. diff --git a/builder/amazon/chroot/step_mount_device.go b/builder/amazon/chroot/step_mount_device.go index 8f740bd6e..07757dba2 100644 --- a/builder/amazon/chroot/step_mount_device.go +++ b/builder/amazon/chroot/step_mount_device.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type mountPathData struct { diff --git a/builder/amazon/chroot/step_mount_extra.go b/builder/amazon/chroot/step_mount_extra.go index fb62467ba..074f40199 100644 --- a/builder/amazon/chroot/step_mount_extra.go +++ b/builder/amazon/chroot/step_mount_extra.go @@ -3,6 +3,8 @@ package chroot import ( "bytes" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "os" "os/exec" "syscall" diff --git a/builder/amazon/chroot/step_post_mount_commands.go b/builder/amazon/chroot/step_post_mount_commands.go index de927f9aa..0ebd68d60 100644 --- a/builder/amazon/chroot/step_post_mount_commands.go +++ b/builder/amazon/chroot/step_post_mount_commands.go @@ -1,8 +1,8 @@ package chroot import ( + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type postMountCommandsData struct { diff --git a/builder/amazon/chroot/step_pre_mount_commands.go b/builder/amazon/chroot/step_pre_mount_commands.go index 63aa6d15a..9a9bf69ac 100644 --- a/builder/amazon/chroot/step_pre_mount_commands.go +++ b/builder/amazon/chroot/step_pre_mount_commands.go @@ -1,8 +1,8 @@ package chroot import ( + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type preMountCommandsData struct { diff --git a/builder/amazon/chroot/step_prepare_device.go b/builder/amazon/chroot/step_prepare_device.go index 6cbefb2cc..18036f0a2 100644 --- a/builder/amazon/chroot/step_prepare_device.go +++ b/builder/amazon/chroot/step_prepare_device.go @@ -5,8 +5,8 @@ import ( "log" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepPrepareDevice finds an available device and sets it. diff --git a/builder/amazon/chroot/step_register_ami.go b/builder/amazon/chroot/step_register_ami.go index a19266f57..c37892723 100644 --- a/builder/amazon/chroot/step_register_ami.go +++ b/builder/amazon/chroot/step_register_ami.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepRegisterAMI creates the AMI. diff --git a/builder/amazon/chroot/step_snapshot.go b/builder/amazon/chroot/step_snapshot.go index 5cd646662..78c7a9a21 100644 --- a/builder/amazon/chroot/step_snapshot.go +++ b/builder/amazon/chroot/step_snapshot.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepSnapshot creates a snapshot of the created volume. diff --git a/builder/amazon/common/ssh.go b/builder/amazon/common/ssh.go index be414a8a0..086bc12ee 100644 --- a/builder/amazon/common/ssh.go +++ b/builder/amazon/common/ssh.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/amazon/common/ssh_test.go b/builder/amazon/common/ssh_test.go index e39088e67..02823d1d9 100644 --- a/builder/amazon/common/ssh_test.go +++ b/builder/amazon/common/ssh_test.go @@ -5,7 +5,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) const ( diff --git a/builder/amazon/common/state.go b/builder/amazon/common/state.go index 42beb0e00..4b5fe0d46 100644 --- a/builder/amazon/common/state.go +++ b/builder/amazon/common/state.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // StateRefreshFunc is a function type used for StateChangeConf that is diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index f98dcbb92..3d9e4f1b6 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepAMIRegionCopy struct { diff --git a/builder/amazon/common/step_create_tags.go b/builder/amazon/common/step_create_tags.go index d3183c7a7..b0170f850 100644 --- a/builder/amazon/common/step_create_tags.go +++ b/builder/amazon/common/step_create_tags.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" retry "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type StepCreateTags struct { diff --git a/builder/amazon/common/step_deregister_ami.go b/builder/amazon/common/step_deregister_ami.go index 188a40808..c8c18aca5 100644 --- a/builder/amazon/common/step_deregister_ami.go +++ b/builder/amazon/common/step_deregister_ami.go @@ -5,8 +5,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepDeregisterAMI struct { diff --git a/builder/amazon/common/step_encrypted_ami.go b/builder/amazon/common/step_encrypted_ami.go index 16c4ce7a8..f47f1a19c 100644 --- a/builder/amazon/common/step_encrypted_ami.go +++ b/builder/amazon/common/step_encrypted_ami.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateEncryptedAMICopy struct { diff --git a/builder/amazon/common/step_get_password.go b/builder/amazon/common/step_get_password.go index b457658b9..50a720ef7 100644 --- a/builder/amazon/common/step_get_password.go +++ b/builder/amazon/common/step_get_password.go @@ -12,8 +12,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepGetPassword reads the password from a Windows server and sets it diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index 68ce5af2d..cc01949c6 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -7,8 +7,8 @@ import ( "runtime" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepKeyPair struct { diff --git a/builder/amazon/common/step_modify_ami_attributes.go b/builder/amazon/common/step_modify_ami_attributes.go index 295d98ce9..dc024d8bb 100644 --- a/builder/amazon/common/step_modify_ami_attributes.go +++ b/builder/amazon/common/step_modify_ami_attributes.go @@ -6,9 +6,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type StepModifyAMIAttributes struct { diff --git a/builder/amazon/common/step_modify_ebs_instance.go b/builder/amazon/common/step_modify_ebs_instance.go index 12c2367aa..0f9da523f 100644 --- a/builder/amazon/common/step_modify_ebs_instance.go +++ b/builder/amazon/common/step_modify_ebs_instance.go @@ -5,8 +5,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepModifyEBSBackedInstance struct { diff --git a/builder/amazon/common/step_pre_validate.go b/builder/amazon/common/step_pre_validate.go index 4c57cce0b..1e4a2b2a5 100644 --- a/builder/amazon/common/step_pre_validate.go +++ b/builder/amazon/common/step_pre_validate.go @@ -5,8 +5,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepPreValidate provides an opportunity to pre-validate any configuration for diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index cf1557c54..9186c868c 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type StepRunSourceInstance struct { diff --git a/builder/amazon/common/step_run_spot_instance.go b/builder/amazon/common/step_run_spot_instance.go index 27938ece6..9968ed962 100644 --- a/builder/amazon/common/step_run_spot_instance.go +++ b/builder/amazon/common/step_run_spot_instance.go @@ -13,9 +13,9 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" retry "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type StepRunSpotInstance struct { diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index 8027903f5..a03f496e6 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -10,8 +10,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/common/uuid" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepSecurityGroup struct { diff --git a/builder/amazon/common/step_source_ami_info.go b/builder/amazon/common/step_source_ami_info.go index c7e9f733e..16e49c546 100644 --- a/builder/amazon/common/step_source_ami_info.go +++ b/builder/amazon/common/step_source_ami_info.go @@ -7,8 +7,8 @@ import ( "time" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepSourceAMIInfo extracts critical information from the source AMI diff --git a/builder/amazon/common/step_stop_ebs_instance.go b/builder/amazon/common/step_stop_ebs_instance.go index 7d6b2e943..6f5be17ce 100644 --- a/builder/amazon/common/step_stop_ebs_instance.go +++ b/builder/amazon/common/step_stop_ebs_instance.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepStopEBSBackedInstance struct { diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index e22901a74..44e14b695 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // The unique ID for this builder diff --git a/builder/amazon/ebs/step_cleanup_volumes.go b/builder/amazon/ebs/step_cleanup_volumes.go index d056f5457..2b4484f3b 100644 --- a/builder/amazon/ebs/step_cleanup_volumes.go +++ b/builder/amazon/ebs/step_cleanup_volumes.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // stepCleanupVolumes cleans up any orphaned volumes that were not designated to diff --git a/builder/amazon/ebs/step_create_ami.go b/builder/amazon/ebs/step_create_ami.go index 9cb4bcee2..2729cc64f 100644 --- a/builder/amazon/ebs/step_create_ami.go +++ b/builder/amazon/ebs/step_create_ami.go @@ -5,8 +5,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateAMI struct { diff --git a/builder/amazon/ebssurrogate/builder.go b/builder/amazon/ebssurrogate/builder.go index c622a4b73..6dba669d8 100644 --- a/builder/amazon/ebssurrogate/builder.go +++ b/builder/amazon/ebssurrogate/builder.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderId = "mitchellh.amazon.ebssurrogate" diff --git a/builder/amazon/ebssurrogate/step_register_ami.go b/builder/amazon/ebssurrogate/step_register_ami.go index f0d145f35..d5c7924db 100644 --- a/builder/amazon/ebssurrogate/step_register_ami.go +++ b/builder/amazon/ebssurrogate/step_register_ami.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepRegisterAMI creates the AMI. diff --git a/builder/amazon/ebssurrogate/step_snapshot_new_root.go b/builder/amazon/ebssurrogate/step_snapshot_new_root.go index e00a75cdb..3b46ca601 100644 --- a/builder/amazon/ebssurrogate/step_snapshot_new_root.go +++ b/builder/amazon/ebssurrogate/step_snapshot_new_root.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepSnapshotNewRootVolume creates a snapshot of the created volume. diff --git a/builder/amazon/ebsvolume/builder.go b/builder/amazon/ebsvolume/builder.go index b95af11f8..83fc271fb 100644 --- a/builder/amazon/ebsvolume/builder.go +++ b/builder/amazon/ebsvolume/builder.go @@ -11,9 +11,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderId = "mitchellh.amazon.ebsvolume" diff --git a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go index 992459560..d99636b57 100644 --- a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go +++ b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go @@ -5,9 +5,9 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type stepTagEBSVolumes struct { diff --git a/builder/amazon/instance/builder.go b/builder/amazon/instance/builder.go index 776f4fc67..828733a9f 100644 --- a/builder/amazon/instance/builder.go +++ b/builder/amazon/instance/builder.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // The unique ID for this builder diff --git a/builder/amazon/instance/step_bundle_volume.go b/builder/amazon/instance/step_bundle_volume.go index a8e27d635..dbce14109 100644 --- a/builder/amazon/instance/step_bundle_volume.go +++ b/builder/amazon/instance/step_bundle_volume.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type bundleCmdData struct { diff --git a/builder/amazon/instance/step_register_ami.go b/builder/amazon/instance/step_register_ami.go index d363bdfdd..348e7b86f 100644 --- a/builder/amazon/instance/step_register_ami.go +++ b/builder/amazon/instance/step_register_ami.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" awscommon "github.com/hashicorp/packer/builder/amazon/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepRegisterAMI struct { diff --git a/builder/amazon/instance/step_upload_bundle.go b/builder/amazon/instance/step_upload_bundle.go index a38a77c93..3a314527e 100644 --- a/builder/amazon/instance/step_upload_bundle.go +++ b/builder/amazon/instance/step_upload_bundle.go @@ -3,9 +3,9 @@ package instance import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type uploadCmdData struct { diff --git a/builder/amazon/instance/step_upload_x509_cert.go b/builder/amazon/instance/step_upload_x509_cert.go index dffcf4d2b..44cd58099 100644 --- a/builder/amazon/instance/step_upload_x509_cert.go +++ b/builder/amazon/instance/step_upload_x509_cert.go @@ -2,10 +2,9 @@ package instance import ( "fmt" - "os" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "os" ) type StepUploadX509Cert struct{} diff --git a/builder/azure/arm/builder.go b/builder/azure/arm/builder.go index d1f98bbd2..62afe6fa5 100644 --- a/builder/azure/arm/builder.go +++ b/builder/azure/arm/builder.go @@ -18,8 +18,8 @@ import ( "github.com/Azure/go-autorest/autorest/adal" packerCommon "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type Builder struct { diff --git a/builder/azure/arm/step.go b/builder/azure/arm/step.go index 707a1a07e..4ac33d1b5 100644 --- a/builder/azure/arm/step.go +++ b/builder/azure/arm/step.go @@ -3,7 +3,7 @@ package arm import ( "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func processInterruptibleResult( diff --git a/builder/azure/arm/step_capture_image.go b/builder/azure/arm/step_capture_image.go index 10d29069e..944f75f3b 100644 --- a/builder/azure/arm/step_capture_image.go +++ b/builder/azure/arm/step_capture_image.go @@ -6,8 +6,8 @@ import ( "github.com/Azure/azure-sdk-for-go/arm/compute" "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCaptureImage struct { diff --git a/builder/azure/arm/step_capture_image_test.go b/builder/azure/arm/step_capture_image_test.go index 4527627a3..2d005d32b 100644 --- a/builder/azure/arm/step_capture_image_test.go +++ b/builder/azure/arm/step_capture_image_test.go @@ -6,7 +6,7 @@ import ( "github.com/Azure/azure-sdk-for-go/arm/compute" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCaptureImageShouldFailIfCaptureFails(t *testing.T) { diff --git a/builder/azure/arm/step_create_resource_group.go b/builder/azure/arm/step_create_resource_group.go index 934cb3225..b9b7662df 100644 --- a/builder/azure/arm/step_create_resource_group.go +++ b/builder/azure/arm/step_create_resource_group.go @@ -6,8 +6,8 @@ import ( "github.com/Azure/azure-sdk-for-go/arm/resources/resources" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateResourceGroup struct { diff --git a/builder/azure/arm/step_create_resource_group_test.go b/builder/azure/arm/step_create_resource_group_test.go index afd47cfef..07ffb78ab 100644 --- a/builder/azure/arm/step_create_resource_group_test.go +++ b/builder/azure/arm/step_create_resource_group_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateResourceGroupShouldFailIfBothGroupNames(t *testing.T) { diff --git a/builder/azure/arm/step_delete_os_disk.go b/builder/azure/arm/step_delete_os_disk.go index 878c45cc6..59c644901 100644 --- a/builder/azure/arm/step_delete_os_disk.go +++ b/builder/azure/arm/step_delete_os_disk.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepDeleteOSDisk struct { diff --git a/builder/azure/arm/step_delete_os_disk_test.go b/builder/azure/arm/step_delete_os_disk_test.go index 5a962dd8a..fea47e766 100644 --- a/builder/azure/arm/step_delete_os_disk_test.go +++ b/builder/azure/arm/step_delete_os_disk_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDeleteOSDiskShouldFailIfGetFails(t *testing.T) { diff --git a/builder/azure/arm/step_delete_resource_group.go b/builder/azure/arm/step_delete_resource_group.go index c3db6de0a..300b8f9e0 100644 --- a/builder/azure/arm/step_delete_resource_group.go +++ b/builder/azure/arm/step_delete_resource_group.go @@ -6,8 +6,8 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/azure/arm/step_delete_resource_group_test.go b/builder/azure/arm/step_delete_resource_group_test.go index c9d6e22da..8b5e3590b 100644 --- a/builder/azure/arm/step_delete_resource_group_test.go +++ b/builder/azure/arm/step_delete_resource_group_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDeleteResourceGroupShouldFailIfDeleteFails(t *testing.T) { diff --git a/builder/azure/arm/step_deploy_template.go b/builder/azure/arm/step_deploy_template.go index 5978a8811..d6c08f7ed 100644 --- a/builder/azure/arm/step_deploy_template.go +++ b/builder/azure/arm/step_deploy_template.go @@ -9,8 +9,8 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepDeployTemplate struct { diff --git a/builder/azure/arm/step_deploy_template_test.go b/builder/azure/arm/step_deploy_template_test.go index 4250e9e0b..16bb52692 100644 --- a/builder/azure/arm/step_deploy_template_test.go +++ b/builder/azure/arm/step_deploy_template_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDeployTemplateShouldFailIfDeployFails(t *testing.T) { diff --git a/builder/azure/arm/step_get_certificate.go b/builder/azure/arm/step_get_certificate.go index b9126da36..80b623f38 100644 --- a/builder/azure/arm/step_get_certificate.go +++ b/builder/azure/arm/step_get_certificate.go @@ -5,8 +5,8 @@ import ( "time" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepGetCertificate struct { diff --git a/builder/azure/arm/step_get_certificate_test.go b/builder/azure/arm/step_get_certificate_test.go index 553806c5e..6823ca1f1 100644 --- a/builder/azure/arm/step_get_certificate_test.go +++ b/builder/azure/arm/step_get_certificate_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepGetCertificateShouldFailIfGetFails(t *testing.T) { diff --git a/builder/azure/arm/step_get_ip_address.go b/builder/azure/arm/step_get_ip_address.go index 2c8165b0b..b6b96addf 100644 --- a/builder/azure/arm/step_get_ip_address.go +++ b/builder/azure/arm/step_get_ip_address.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type EndpointType int diff --git a/builder/azure/arm/step_get_ip_address_test.go b/builder/azure/arm/step_get_ip_address_test.go index 1403e9a51..508aa2b08 100644 --- a/builder/azure/arm/step_get_ip_address_test.go +++ b/builder/azure/arm/step_get_ip_address_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepGetIPAddressShouldFailIfGetFails(t *testing.T) { diff --git a/builder/azure/arm/step_get_os_disk.go b/builder/azure/arm/step_get_os_disk.go index 511ab5c51..314fc8375 100644 --- a/builder/azure/arm/step_get_os_disk.go +++ b/builder/azure/arm/step_get_os_disk.go @@ -7,8 +7,8 @@ import ( "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepGetOSDisk struct { diff --git a/builder/azure/arm/step_get_os_disk_test.go b/builder/azure/arm/step_get_os_disk_test.go index 2b3a4d5d6..614684db7 100644 --- a/builder/azure/arm/step_get_os_disk_test.go +++ b/builder/azure/arm/step_get_os_disk_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepGetOSDiskShouldFailIfGetFails(t *testing.T) { diff --git a/builder/azure/arm/step_power_off_compute.go b/builder/azure/arm/step_power_off_compute.go index 931050e04..a1401faed 100644 --- a/builder/azure/arm/step_power_off_compute.go +++ b/builder/azure/arm/step_power_off_compute.go @@ -5,8 +5,8 @@ import ( "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepPowerOffCompute struct { diff --git a/builder/azure/arm/step_power_off_compute_test.go b/builder/azure/arm/step_power_off_compute_test.go index 2dcdac7f6..e1d6c6b7d 100644 --- a/builder/azure/arm/step_power_off_compute_test.go +++ b/builder/azure/arm/step_power_off_compute_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepPowerOffComputeShouldFailIfPowerOffFails(t *testing.T) { diff --git a/builder/azure/arm/step_set_certificate.go b/builder/azure/arm/step_set_certificate.go index 5e865b882..34e308263 100644 --- a/builder/azure/arm/step_set_certificate.go +++ b/builder/azure/arm/step_set_certificate.go @@ -2,8 +2,8 @@ package arm import ( "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepSetCertificate struct { diff --git a/builder/azure/arm/step_set_certificate_test.go b/builder/azure/arm/step_set_certificate_test.go index 1ad9b7dbe..8adc6f19e 100644 --- a/builder/azure/arm/step_set_certificate_test.go +++ b/builder/azure/arm/step_set_certificate_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepSetCertificateShouldPassIfGetPasses(t *testing.T) { diff --git a/builder/azure/arm/step_test.go b/builder/azure/arm/step_test.go index cf89021c3..c0115b003 100644 --- a/builder/azure/arm/step_test.go +++ b/builder/azure/arm/step_test.go @@ -6,7 +6,8 @@ import ( "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" + "testing" ) func TestProcessStepResultShouldContinueForNonErrors(t *testing.T) { diff --git a/builder/azure/arm/step_validate_template.go b/builder/azure/arm/step_validate_template.go index d2b98638b..3c7f98a8a 100644 --- a/builder/azure/arm/step_validate_template.go +++ b/builder/azure/arm/step_validate_template.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepValidateTemplate struct { diff --git a/builder/azure/arm/step_validate_template_test.go b/builder/azure/arm/step_validate_template_test.go index a56030787..310c6b49c 100644 --- a/builder/azure/arm/step_validate_template_test.go +++ b/builder/azure/arm/step_validate_template_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepValidateTemplateShouldFailIfValidateFails(t *testing.T) { diff --git a/builder/azure/common/lin/ssh.go b/builder/azure/common/lin/ssh.go index 1600c2f4f..0987a04ea 100644 --- a/builder/azure/common/lin/ssh.go +++ b/builder/azure/common/lin/ssh.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/packer/builder/azure/common/constants" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/azure/common/lin/step_create_cert.go b/builder/azure/common/lin/step_create_cert.go index 6f6a685d3..809bdd964 100644 --- a/builder/azure/common/lin/step_create_cert.go +++ b/builder/azure/common/lin/step_create_cert.go @@ -14,8 +14,8 @@ import ( "github.com/hashicorp/packer/builder/azure/common/constants" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateCert struct { diff --git a/builder/azure/common/lin/step_generalize_os.go b/builder/azure/common/lin/step_generalize_os.go index ba11a9def..bd55365a2 100644 --- a/builder/azure/common/lin/step_generalize_os.go +++ b/builder/azure/common/lin/step_generalize_os.go @@ -3,10 +3,9 @@ package lin import ( "bytes" "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) type StepGeneralizeOS struct { diff --git a/builder/azure/common/state_bag.go b/builder/azure/common/state_bag.go index a402518a1..57889c03f 100644 --- a/builder/azure/common/state_bag.go +++ b/builder/azure/common/state_bag.go @@ -1,6 +1,6 @@ package common -import "github.com/mitchellh/multistep" +import "github.com/hashicorp/packer/helper/multistep" func IsStateCancelled(stateBag multistep.StateBag) bool { _, ok := stateBag.GetOk(multistep.StateCancelled) diff --git a/builder/cloudstack/builder.go b/builder/cloudstack/builder.go index 27af37d17..6726b29f9 100644 --- a/builder/cloudstack/builder.go +++ b/builder/cloudstack/builder.go @@ -5,8 +5,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/ssh.go b/builder/cloudstack/ssh.go index 7a4c2fcba..e1c2ef846 100644 --- a/builder/cloudstack/ssh.go +++ b/builder/cloudstack/ssh.go @@ -6,7 +6,7 @@ import ( "os" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/cloudstack/step_configure_networking.go b/builder/cloudstack/step_configure_networking.go index d9a6a365c..ff80583e9 100644 --- a/builder/cloudstack/step_configure_networking.go +++ b/builder/cloudstack/step_configure_networking.go @@ -6,8 +6,8 @@ import ( "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_create_instance.go b/builder/cloudstack/step_create_instance.go index 3e37fad14..578adb898 100644 --- a/builder/cloudstack/step_create_instance.go +++ b/builder/cloudstack/step_create_instance.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_create_security_group.go b/builder/cloudstack/step_create_security_group.go index 1bf23100b..372df29f7 100644 --- a/builder/cloudstack/step_create_security_group.go +++ b/builder/cloudstack/step_create_security_group.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_create_template.go b/builder/cloudstack/step_create_template.go index 18d6c1fb0..54345fb25 100644 --- a/builder/cloudstack/step_create_template.go +++ b/builder/cloudstack/step_create_template.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_keypair.go b/builder/cloudstack/step_keypair.go index 675994fc1..8ecd2d1b5 100644 --- a/builder/cloudstack/step_keypair.go +++ b/builder/cloudstack/step_keypair.go @@ -6,8 +6,8 @@ import ( "os" "runtime" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_prepare_config.go b/builder/cloudstack/step_prepare_config.go index 4d6353c6a..12c1c44fe 100644 --- a/builder/cloudstack/step_prepare_config.go +++ b/builder/cloudstack/step_prepare_config.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "regexp" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/cloudstack/step_shutdown_instance.go b/builder/cloudstack/step_shutdown_instance.go index b090a5836..fce1fa8bc 100644 --- a/builder/cloudstack/step_shutdown_instance.go +++ b/builder/cloudstack/step_shutdown_instance.go @@ -3,8 +3,8 @@ package cloudstack import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/xanzy/go-cloudstack/cloudstack" ) diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go index 16d11ba29..d5e674d63 100644 --- a/builder/digitalocean/builder.go +++ b/builder/digitalocean/builder.go @@ -12,8 +12,8 @@ import ( "github.com/digitalocean/godo" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/oauth2" ) diff --git a/builder/digitalocean/ssh.go b/builder/digitalocean/ssh.go index ebccb938a..2b5c4ef8d 100644 --- a/builder/digitalocean/ssh.go +++ b/builder/digitalocean/ssh.go @@ -5,7 +5,7 @@ import ( "golang.org/x/crypto/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func commHost(state multistep.StateBag) (string, error) { diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index ed2c7390d..d64224a0a 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "github.com/digitalocean/godo" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateDroplet struct { diff --git a/builder/digitalocean/step_create_ssh_key.go b/builder/digitalocean/step_create_ssh_key.go index d255ffde0..cd8f68cc0 100644 --- a/builder/digitalocean/step_create_ssh_key.go +++ b/builder/digitalocean/step_create_ssh_key.go @@ -13,8 +13,8 @@ import ( "github.com/digitalocean/godo" "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/digitalocean/step_droplet_info.go b/builder/digitalocean/step_droplet_info.go index 4d24bb899..8cb0f6112 100644 --- a/builder/digitalocean/step_droplet_info.go +++ b/builder/digitalocean/step_droplet_info.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/digitalocean/godo" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepDropletInfo struct{} diff --git a/builder/digitalocean/step_power_off.go b/builder/digitalocean/step_power_off.go index aeded228a..a5ed96199 100644 --- a/builder/digitalocean/step_power_off.go +++ b/builder/digitalocean/step_power_off.go @@ -6,8 +6,8 @@ import ( "log" "github.com/digitalocean/godo" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepPowerOff struct{} diff --git a/builder/digitalocean/step_shutdown.go b/builder/digitalocean/step_shutdown.go index dfa47dc4a..d45f03628 100644 --- a/builder/digitalocean/step_shutdown.go +++ b/builder/digitalocean/step_shutdown.go @@ -7,8 +7,8 @@ import ( "time" "github.com/digitalocean/godo" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepShutdown struct{} diff --git a/builder/digitalocean/step_snapshot.go b/builder/digitalocean/step_snapshot.go index eb91fdead..46eb75a0e 100644 --- a/builder/digitalocean/step_snapshot.go +++ b/builder/digitalocean/step_snapshot.go @@ -8,8 +8,8 @@ import ( "time" "github.com/digitalocean/godo" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepSnapshot struct{} diff --git a/builder/docker/builder.go b/builder/docker/builder.go index c59456e80..ba58f61bb 100644 --- a/builder/docker/builder.go +++ b/builder/docker/builder.go @@ -5,8 +5,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/docker/comm.go b/builder/docker/comm.go index 8af3d57ca..bda53e0a1 100644 --- a/builder/docker/comm.go +++ b/builder/docker/comm.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/packer/communicator/ssh" "github.com/hashicorp/packer/helper/communicator" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/docker/step_commit.go b/builder/docker/step_commit.go index 26455670c..167f68621 100644 --- a/builder/docker/step_commit.go +++ b/builder/docker/step_commit.go @@ -2,9 +2,8 @@ package docker import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCommit commits the container to a image. diff --git a/builder/docker/step_commit_test.go b/builder/docker/step_commit_test.go index dce1b1208..b828aa3e2 100644 --- a/builder/docker/step_commit_test.go +++ b/builder/docker/step_commit_test.go @@ -2,6 +2,7 @@ package docker import ( "errors" + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/docker/step_connect_docker.go b/builder/docker/step_connect_docker.go index ecbe55c35..ed64091e7 100644 --- a/builder/docker/step_connect_docker.go +++ b/builder/docker/step_connect_docker.go @@ -2,6 +2,7 @@ package docker import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "os/exec" "strings" diff --git a/builder/docker/step_export.go b/builder/docker/step_export.go index 428055a48..7af86de0e 100644 --- a/builder/docker/step_export.go +++ b/builder/docker/step_export.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepExport exports the container to a flat tar file. diff --git a/builder/docker/step_export_test.go b/builder/docker/step_export_test.go index f2d1a069c..622d0ee5a 100644 --- a/builder/docker/step_export_test.go +++ b/builder/docker/step_export_test.go @@ -3,6 +3,7 @@ package docker import ( "bytes" "errors" + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" diff --git a/builder/docker/step_pull.go b/builder/docker/step_pull.go index 6b1ac8935..8704de3d1 100644 --- a/builder/docker/step_pull.go +++ b/builder/docker/step_pull.go @@ -4,8 +4,8 @@ import ( "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepPull struct{} diff --git a/builder/docker/step_pull_test.go b/builder/docker/step_pull_test.go index aaeff2b2a..6bd3d5e84 100644 --- a/builder/docker/step_pull_test.go +++ b/builder/docker/step_pull_test.go @@ -2,6 +2,7 @@ package docker import ( "errors" + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/docker/step_run.go b/builder/docker/step_run.go index 101788682..2ac471562 100644 --- a/builder/docker/step_run.go +++ b/builder/docker/step_run.go @@ -2,9 +2,8 @@ package docker import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepRun struct { diff --git a/builder/docker/step_run_test.go b/builder/docker/step_run_test.go index 8c5b08ea3..e301a11c5 100644 --- a/builder/docker/step_run_test.go +++ b/builder/docker/step_run_test.go @@ -2,6 +2,7 @@ package docker import ( "errors" + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/docker/step_temp_dir.go b/builder/docker/step_temp_dir.go index c7312ce49..e9af747e7 100644 --- a/builder/docker/step_temp_dir.go +++ b/builder/docker/step_temp_dir.go @@ -2,6 +2,8 @@ package docker import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "io/ioutil" "os" diff --git a/builder/docker/step_temp_dir_test.go b/builder/docker/step_temp_dir_test.go index cc12932f3..68c8d0455 100644 --- a/builder/docker/step_temp_dir_test.go +++ b/builder/docker/step_temp_dir_test.go @@ -5,8 +5,8 @@ import ( "path/filepath" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepTempDir_impl(t *testing.T) { diff --git a/builder/docker/step_test.go b/builder/docker/step_test.go index 9eec9a5d8..fa0702612 100644 --- a/builder/docker/step_test.go +++ b/builder/docker/step_test.go @@ -2,10 +2,9 @@ package docker import ( "bytes" - "testing" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/file/builder.go b/builder/file/builder.go index 1ac87331c..f8b52e609 100644 --- a/builder/file/builder.go +++ b/builder/file/builder.go @@ -11,8 +11,8 @@ import ( "io/ioutil" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const BuilderId = "packer.file" diff --git a/builder/googlecompute/builder.go b/builder/googlecompute/builder.go index 589108348..c60117075 100644 --- a/builder/googlecompute/builder.go +++ b/builder/googlecompute/builder.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // The unique ID for this builder. diff --git a/builder/googlecompute/ssh.go b/builder/googlecompute/ssh.go index 5c224f0c6..bf704b13e 100644 --- a/builder/googlecompute/ssh.go +++ b/builder/googlecompute/ssh.go @@ -3,7 +3,7 @@ package googlecompute import ( "fmt" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/googlecompute/step_check_existing_image.go b/builder/googlecompute/step_check_existing_image.go index d5f2f5e73..b2da36973 100644 --- a/builder/googlecompute/step_check_existing_image.go +++ b/builder/googlecompute/step_check_existing_image.go @@ -3,8 +3,8 @@ package googlecompute import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCheckExistingImage represents a Packer build step that checks if the diff --git a/builder/googlecompute/step_check_existing_image_test.go b/builder/googlecompute/step_check_existing_image_test.go index 21f4ee6c2..36f9e110a 100644 --- a/builder/googlecompute/step_check_existing_image_test.go +++ b/builder/googlecompute/step_check_existing_image_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/googlecompute/step_create_image.go b/builder/googlecompute/step_create_image.go index bcb840e78..7948c0188 100644 --- a/builder/googlecompute/step_create_image.go +++ b/builder/googlecompute/step_create_image.go @@ -5,8 +5,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateImage represents a Packer build step that creates GCE machine diff --git a/builder/googlecompute/step_create_image_test.go b/builder/googlecompute/step_create_image_test.go index 639b25255..e920e03f2 100644 --- a/builder/googlecompute/step_create_image_test.go +++ b/builder/googlecompute/step_create_image_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index a4509354e..054d169ae 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateInstance represents a Packer build step that creates GCE instances. diff --git a/builder/googlecompute/step_create_instance_test.go b/builder/googlecompute/step_create_instance_test.go index a9a91d692..5a497a78e 100644 --- a/builder/googlecompute/step_create_instance_test.go +++ b/builder/googlecompute/step_create_instance_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) diff --git a/builder/googlecompute/step_create_ssh_key.go b/builder/googlecompute/step_create_ssh_key.go index fd6d7f55a..9c0ad5513 100644 --- a/builder/googlecompute/step_create_ssh_key.go +++ b/builder/googlecompute/step_create_ssh_key.go @@ -9,8 +9,8 @@ import ( "io/ioutil" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/googlecompute/step_create_ssh_key_test.go b/builder/googlecompute/step_create_ssh_key_test.go index 94504ac7f..31481e8b6 100644 --- a/builder/googlecompute/step_create_ssh_key_test.go +++ b/builder/googlecompute/step_create_ssh_key_test.go @@ -1,7 +1,7 @@ package googlecompute import ( - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" diff --git a/builder/googlecompute/step_create_windows_password.go b/builder/googlecompute/step_create_windows_password.go index 312e54512..3adeac11d 100644 --- a/builder/googlecompute/step_create_windows_password.go +++ b/builder/googlecompute/step_create_windows_password.go @@ -12,8 +12,8 @@ import ( "os" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateWindowsPassword represents a Packer build step that sets the windows password on a Windows GCE instance. diff --git a/builder/googlecompute/step_create_windows_password_test.go b/builder/googlecompute/step_create_windows_password_test.go index 58fc8ee83..2b0050b1d 100644 --- a/builder/googlecompute/step_create_windows_password_test.go +++ b/builder/googlecompute/step_create_windows_password_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "os" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "testing" ) diff --git a/builder/googlecompute/step_instance_info.go b/builder/googlecompute/step_instance_info.go index d5ece22e7..8706489c9 100644 --- a/builder/googlecompute/step_instance_info.go +++ b/builder/googlecompute/step_instance_info.go @@ -5,8 +5,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // stepInstanceInfo represents a Packer build step that gathers GCE instance info. diff --git a/builder/googlecompute/step_instance_info_test.go b/builder/googlecompute/step_instance_info_test.go index b8547f2ff..8ced83c5d 100644 --- a/builder/googlecompute/step_instance_info_test.go +++ b/builder/googlecompute/step_instance_info_test.go @@ -2,6 +2,7 @@ package googlecompute import ( "errors" + "github.com/hashicorp/packer/helper/multistep" "testing" "time" diff --git a/builder/googlecompute/step_teardown_instance.go b/builder/googlecompute/step_teardown_instance.go index 58585d78f..317507d82 100644 --- a/builder/googlecompute/step_teardown_instance.go +++ b/builder/googlecompute/step_teardown_instance.go @@ -5,8 +5,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepTeardownInstance represents a Packer build step that tears down GCE diff --git a/builder/googlecompute/step_teardown_instance_test.go b/builder/googlecompute/step_teardown_instance_test.go index 28c6480de..295230e01 100644 --- a/builder/googlecompute/step_teardown_instance_test.go +++ b/builder/googlecompute/step_teardown_instance_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/googlecompute/step_test.go b/builder/googlecompute/step_test.go index 3e9b843f4..a50bde49f 100644 --- a/builder/googlecompute/step_test.go +++ b/builder/googlecompute/step_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/googlecompute/step_wait_startup_script.go b/builder/googlecompute/step_wait_startup_script.go index f2e1e523f..94b1b07ce 100644 --- a/builder/googlecompute/step_wait_startup_script.go +++ b/builder/googlecompute/step_wait_startup_script.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepWaitStartupScript int diff --git a/builder/googlecompute/step_wait_startup_script_test.go b/builder/googlecompute/step_wait_startup_script_test.go index d157c761f..a48176a61 100644 --- a/builder/googlecompute/step_wait_startup_script_test.go +++ b/builder/googlecompute/step_wait_startup_script_test.go @@ -1,9 +1,7 @@ package googlecompute import ( - "testing" - - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) diff --git a/builder/googlecompute/winrm.go b/builder/googlecompute/winrm.go index ec617cba5..767787401 100644 --- a/builder/googlecompute/winrm.go +++ b/builder/googlecompute/winrm.go @@ -2,7 +2,7 @@ package googlecompute import ( "github.com/hashicorp/packer/helper/communicator" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // winrmConfig returns the WinRM configuration. diff --git a/builder/hyperv/common/ssh.go b/builder/hyperv/common/ssh.go index 182d154ff..f8a059bb0 100644 --- a/builder/hyperv/common/ssh.go +++ b/builder/hyperv/common/ssh.go @@ -3,7 +3,7 @@ package common import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/hyperv/common/step_clone_vm.go b/builder/hyperv/common/step_clone_vm.go index 4a5b55566..733b6df1a 100644 --- a/builder/hyperv/common/step_clone_vm.go +++ b/builder/hyperv/common/step_clone_vm.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step clones an existing virtual machine. diff --git a/builder/hyperv/common/step_configure_ip.go b/builder/hyperv/common/step_configure_ip.go index deac917f8..8670f5a41 100644 --- a/builder/hyperv/common/step_configure_ip.go +++ b/builder/hyperv/common/step_configure_ip.go @@ -6,8 +6,8 @@ import ( "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepConfigureIp struct { diff --git a/builder/hyperv/common/step_configure_vlan.go b/builder/hyperv/common/step_configure_vlan.go index 5d713ac99..acfe26422 100644 --- a/builder/hyperv/common/step_configure_vlan.go +++ b/builder/hyperv/common/step_configure_vlan.go @@ -3,8 +3,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepConfigureVlan struct { diff --git a/builder/hyperv/common/step_create_external_switch.go b/builder/hyperv/common/step_create_external_switch.go index 8443202b3..1bbfd40b7 100644 --- a/builder/hyperv/common/step_create_external_switch.go +++ b/builder/hyperv/common/step_create_external_switch.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/hashicorp/packer/common/uuid" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates switch for VM. diff --git a/builder/hyperv/common/step_create_switch.go b/builder/hyperv/common/step_create_switch.go index 1904c9dbd..7d6db4c3d 100644 --- a/builder/hyperv/common/step_create_switch.go +++ b/builder/hyperv/common/step_create_switch.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/hyperv/common/step_create_tempdir.go b/builder/hyperv/common/step_create_tempdir.go index c2ac9f719..425235258 100644 --- a/builder/hyperv/common/step_create_tempdir.go +++ b/builder/hyperv/common/step_create_tempdir.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepCreateTempDir struct { diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index 02171d9c6..6f850a044 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates the actual virtual machine. diff --git a/builder/hyperv/common/step_disable_vlan.go b/builder/hyperv/common/step_disable_vlan.go index fb1454af3..6c6a034da 100644 --- a/builder/hyperv/common/step_disable_vlan.go +++ b/builder/hyperv/common/step_disable_vlan.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepDisableVlan struct { diff --git a/builder/hyperv/common/step_enable_integration_service.go b/builder/hyperv/common/step_enable_integration_service.go index 852e3d804..98e8eedb2 100644 --- a/builder/hyperv/common/step_enable_integration_service.go +++ b/builder/hyperv/common/step_enable_integration_service.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepEnableIntegrationService struct { diff --git a/builder/hyperv/common/step_export_vm.go b/builder/hyperv/common/step_export_vm.go index 8c32052a3..3c33475c1 100644 --- a/builder/hyperv/common/step_export_vm.go +++ b/builder/hyperv/common/step_export_vm.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index 2f800a79c..97d3ff0e0 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "path/filepath" "strings" diff --git a/builder/hyperv/common/step_mount_floppydrive.go b/builder/hyperv/common/step_mount_floppydrive.go index d49b155b5..749cf5ae1 100644 --- a/builder/hyperv/common/step_mount_floppydrive.go +++ b/builder/hyperv/common/step_mount_floppydrive.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "io" "io/ioutil" "log" diff --git a/builder/hyperv/common/step_mount_guest_additions.go b/builder/hyperv/common/step_mount_guest_additions.go index fafa92971..1cf549735 100644 --- a/builder/hyperv/common/step_mount_guest_additions.go +++ b/builder/hyperv/common/step_mount_guest_additions.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) type StepMountGuestAdditions struct { diff --git a/builder/hyperv/common/step_mount_secondary_dvd_images.go b/builder/hyperv/common/step_mount_secondary_dvd_images.go index 2b7934a5e..c5be1a03b 100644 --- a/builder/hyperv/common/step_mount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_mount_secondary_dvd_images.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) type StepMountSecondaryDvdImages struct { diff --git a/builder/hyperv/common/step_output_dir.go b/builder/hyperv/common/step_output_dir.go index 0054d1994..acb905e9a 100644 --- a/builder/hyperv/common/step_output_dir.go +++ b/builder/hyperv/common/step_output_dir.go @@ -7,8 +7,8 @@ import ( "path/filepath" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepOutputDir sets up the output directory by creating it if it does diff --git a/builder/hyperv/common/step_polling_installation.go b/builder/hyperv/common/step_polling_installation.go index 8586940b1..114684f59 100644 --- a/builder/hyperv/common/step_polling_installation.go +++ b/builder/hyperv/common/step_polling_installation.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const port string = "13000" diff --git a/builder/hyperv/common/step_reboot_vm.go b/builder/hyperv/common/step_reboot_vm.go index 0ba777e6f..3708f97cb 100644 --- a/builder/hyperv/common/step_reboot_vm.go +++ b/builder/hyperv/common/step_reboot_vm.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) type StepRebootVm struct { diff --git a/builder/hyperv/common/step_run.go b/builder/hyperv/common/step_run.go index 050c76f50..168f29520 100644 --- a/builder/hyperv/common/step_run.go +++ b/builder/hyperv/common/step_run.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) type StepRun struct { diff --git a/builder/hyperv/common/step_shutdown.go b/builder/hyperv/common/step_shutdown.go index 9b341b395..42e408799 100644 --- a/builder/hyperv/common/step_shutdown.go +++ b/builder/hyperv/common/step_shutdown.go @@ -7,8 +7,8 @@ import ( "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step shuts down the machine. It first attempts to do so gracefully, diff --git a/builder/hyperv/common/step_sleep.go b/builder/hyperv/common/step_sleep.go index ea262d010..19b4c2c1f 100644 --- a/builder/hyperv/common/step_sleep.go +++ b/builder/hyperv/common/step_sleep.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) type StepSleep struct { diff --git a/builder/hyperv/common/step_type_boot_command.go b/builder/hyperv/common/step_type_boot_command.go index dfeca6196..d38c53166 100644 --- a/builder/hyperv/common/step_type_boot_command.go +++ b/builder/hyperv/common/step_type_boot_command.go @@ -8,9 +8,9 @@ import ( "unicode/utf8" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type bootCommandTemplateData struct { diff --git a/builder/hyperv/common/step_unmount_dvddrive.go b/builder/hyperv/common/step_unmount_dvddrive.go index d8ba2033b..810e055ce 100644 --- a/builder/hyperv/common/step_unmount_dvddrive.go +++ b/builder/hyperv/common/step_unmount_dvddrive.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepUnmountDvdDrive struct { diff --git a/builder/hyperv/common/step_unmount_floppydrive.go b/builder/hyperv/common/step_unmount_floppydrive.go index e67279a5f..be71861c2 100644 --- a/builder/hyperv/common/step_unmount_floppydrive.go +++ b/builder/hyperv/common/step_unmount_floppydrive.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepUnmountFloppyDrive struct { diff --git a/builder/hyperv/common/step_unmount_guest_additions.go b/builder/hyperv/common/step_unmount_guest_additions.go index da35a06e2..44b9b5acb 100644 --- a/builder/hyperv/common/step_unmount_guest_additions.go +++ b/builder/hyperv/common/step_unmount_guest_additions.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepUnmountGuestAdditions struct { diff --git a/builder/hyperv/common/step_unmount_secondary_dvd_images.go b/builder/hyperv/common/step_unmount_secondary_dvd_images.go index ec42923f6..9e3ccbfc9 100644 --- a/builder/hyperv/common/step_unmount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_unmount_secondary_dvd_images.go @@ -2,9 +2,8 @@ package common import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepUnmountSecondaryDvdImages struct { diff --git a/builder/hyperv/common/step_wait_for_install_to_complete.go b/builder/hyperv/common/step_wait_for_install_to_complete.go index c002f57ae..a147d6963 100644 --- a/builder/hyperv/common/step_wait_for_install_to_complete.go +++ b/builder/hyperv/common/step_wait_for_install_to_complete.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) const ( diff --git a/builder/hyperv/iso/builder.go b/builder/hyperv/iso/builder.go index 849cbcacf..c905d21e6 100644 --- a/builder/hyperv/iso/builder.go +++ b/builder/hyperv/iso/builder.go @@ -14,9 +14,9 @@ import ( "github.com/hashicorp/packer/common/powershell/hyperv" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/hyperv/iso/builder_test.go b/builder/hyperv/iso/builder_test.go index 7315b4950..74c8de44e 100644 --- a/builder/hyperv/iso/builder_test.go +++ b/builder/hyperv/iso/builder_test.go @@ -9,8 +9,9 @@ import ( "os" hypervcommon "github.com/hashicorp/packer/builder/hyperv/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "os" ) func testConfig() map[string]interface{} { diff --git a/builder/hyperv/vmcx/builder.go b/builder/hyperv/vmcx/builder.go index 6a976b3df..a0238ede1 100644 --- a/builder/hyperv/vmcx/builder.go +++ b/builder/hyperv/vmcx/builder.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/packer/common/powershell/hyperv" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/hyperv/vmcx/builder_test.go b/builder/hyperv/vmcx/builder_test.go index aef12c055..7792a365c 100644 --- a/builder/hyperv/vmcx/builder_test.go +++ b/builder/hyperv/vmcx/builder_test.go @@ -9,8 +9,10 @@ import ( "os" hypervcommon "github.com/hashicorp/packer/builder/hyperv/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "io/ioutil" + "os" ) func testConfig() map[string]interface{} { diff --git a/builder/lxc/builder.go b/builder/lxc/builder.go index b45bd3511..82683b890 100644 --- a/builder/lxc/builder.go +++ b/builder/lxc/builder.go @@ -6,9 +6,12 @@ import ( "path/filepath" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" + "log" + "os" + "path/filepath" ) // The unique ID for this builder diff --git a/builder/lxc/step_export.go b/builder/lxc/step_export.go index 7a0e1ec95..632891a36 100644 --- a/builder/lxc/step_export.go +++ b/builder/lxc/step_export.go @@ -3,6 +3,8 @@ package lxc import ( "bytes" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "io" "log" "os" diff --git a/builder/lxc/step_lxc_create.go b/builder/lxc/step_lxc_create.go index 131fc958b..4d46a0f5c 100644 --- a/builder/lxc/step_lxc_create.go +++ b/builder/lxc/step_lxc_create.go @@ -3,6 +3,8 @@ package lxc import ( "bytes" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "os/exec" "path/filepath" diff --git a/builder/lxc/step_prepare_output_dir.go b/builder/lxc/step_prepare_output_dir.go index 835bbf5a3..ed79ac75e 100644 --- a/builder/lxc/step_prepare_output_dir.go +++ b/builder/lxc/step_prepare_output_dir.go @@ -1,6 +1,8 @@ package lxc import ( + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "os" "time" diff --git a/builder/lxc/step_provision.go b/builder/lxc/step_provision.go index 9c54b9603..c6d7f305e 100644 --- a/builder/lxc/step_provision.go +++ b/builder/lxc/step_provision.go @@ -1,10 +1,9 @@ package lxc import ( - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // StepProvision provisions the instance within a chroot. diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index 69ce8a5af..1c850a90b 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -3,6 +3,8 @@ package lxc import ( "errors" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "strings" "time" diff --git a/builder/lxd/builder.go b/builder/lxd/builder.go index 48a879543..d1b040853 100644 --- a/builder/lxd/builder.go +++ b/builder/lxd/builder.go @@ -4,9 +4,10 @@ import ( "log" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" + "log" ) // The unique ID for this builder diff --git a/builder/lxd/step_lxd_launch.go b/builder/lxd/step_lxd_launch.go index d8ad17734..491a880a9 100644 --- a/builder/lxd/step_lxd_launch.go +++ b/builder/lxd/step_lxd_launch.go @@ -2,10 +2,9 @@ package lxd import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) type stepLxdLaunch struct{} diff --git a/builder/lxd/step_provision.go b/builder/lxd/step_provision.go index 5fbc9d034..6bd7d617c 100644 --- a/builder/lxd/step_provision.go +++ b/builder/lxd/step_provision.go @@ -1,10 +1,9 @@ package lxd import ( - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // StepProvision provisions the container diff --git a/builder/lxd/step_publish.go b/builder/lxd/step_publish.go index 19a8c22af..280dfe1cf 100644 --- a/builder/lxd/step_publish.go +++ b/builder/lxd/step_publish.go @@ -2,10 +2,9 @@ package lxd import ( "fmt" - "regexp" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "regexp" ) type stepPublish struct{} diff --git a/builder/null/builder.go b/builder/null/builder.go index 3e587ebd0..f4d4764d6 100644 --- a/builder/null/builder.go +++ b/builder/null/builder.go @@ -5,8 +5,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const BuilderId = "fnoeding.null" diff --git a/builder/null/ssh.go b/builder/null/ssh.go index b8dea896e..8e18bb6ac 100644 --- a/builder/null/ssh.go +++ b/builder/null/ssh.go @@ -7,7 +7,7 @@ import ( "os" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/oneandone/builder.go b/builder/oneandone/builder.go index 673e35264..7b7be84aa 100644 --- a/builder/oneandone/builder.go +++ b/builder/oneandone/builder.go @@ -7,8 +7,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) const BuilderId = "packer.oneandone" diff --git a/builder/oneandone/ssh.go b/builder/oneandone/ssh.go index 69fb435e1..9fdb128a9 100644 --- a/builder/oneandone/ssh.go +++ b/builder/oneandone/ssh.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/oneandone/step_create_server.go b/builder/oneandone/step_create_server.go index 7f38311a6..505a80242 100644 --- a/builder/oneandone/step_create_server.go +++ b/builder/oneandone/step_create_server.go @@ -6,8 +6,10 @@ import ( "time" "github.com/1and1/oneandone-cloudserver-sdk-go" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "strings" + "time" ) type stepCreateServer struct{} diff --git a/builder/oneandone/step_create_sshkey.go b/builder/oneandone/step_create_sshkey.go index e4174ef5d..e365a1362 100644 --- a/builder/oneandone/step_create_sshkey.go +++ b/builder/oneandone/step_create_sshkey.go @@ -4,10 +4,8 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/oneandone/step_take_snapshot.go b/builder/oneandone/step_take_snapshot.go index b19790c7d..2e6192d13 100644 --- a/builder/oneandone/step_take_snapshot.go +++ b/builder/oneandone/step_take_snapshot.go @@ -2,8 +2,8 @@ package oneandone import ( "github.com/1and1/oneandone-cloudserver-sdk-go" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepTakeSnapshot struct{} diff --git a/builder/openstack/builder.go b/builder/openstack/builder.go index 46d0e4e67..f3c6fd13b 100644 --- a/builder/openstack/builder.go +++ b/builder/openstack/builder.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // The unique ID for this builder diff --git a/builder/openstack/server.go b/builder/openstack/server.go index 2c2dd8f2a..f509452d6 100644 --- a/builder/openstack/server.go +++ b/builder/openstack/server.go @@ -8,7 +8,7 @@ import ( "github.com/gophercloud/gophercloud" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // StateRefreshFunc is a function type used for StateChangeConf that is diff --git a/builder/openstack/ssh.go b/builder/openstack/ssh.go index 9957c6163..1dd6672c4 100644 --- a/builder/openstack/ssh.go +++ b/builder/openstack/ssh.go @@ -12,7 +12,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/openstack/step_add_image_members.go b/builder/openstack/step_add_image_members.go index 642ed3d46..3160a0e46 100644 --- a/builder/openstack/step_add_image_members.go +++ b/builder/openstack/step_add_image_members.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/gophercloud/gophercloud/openstack/imageservice/v2/members" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepAddImageMembers struct{} diff --git a/builder/openstack/step_allocate_ip.go b/builder/openstack/step_allocate_ip.go index 521e42634..2de35b8ee 100644 --- a/builder/openstack/step_allocate_ip.go +++ b/builder/openstack/step_allocate_ip.go @@ -6,8 +6,8 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" "github.com/gophercloud/gophercloud/pagination" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepAllocateIp struct { diff --git a/builder/openstack/step_create_image.go b/builder/openstack/step_create_image.go index 126bd4971..35fbd371a 100644 --- a/builder/openstack/step_create_image.go +++ b/builder/openstack/step_create_image.go @@ -8,8 +8,8 @@ import ( "github.com/gophercloud/gophercloud" "github.com/gophercloud/gophercloud/openstack/compute/v2/images" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateImage struct{} diff --git a/builder/openstack/step_get_password.go b/builder/openstack/step_get_password.go index 10800d5be..9a5d8c95d 100644 --- a/builder/openstack/step_get_password.go +++ b/builder/openstack/step_get_password.go @@ -8,8 +8,8 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/openstack/step_key_pair.go b/builder/openstack/step_key_pair.go index 2d1500a5c..b6b072216 100644 --- a/builder/openstack/step_key_pair.go +++ b/builder/openstack/step_key_pair.go @@ -9,8 +9,8 @@ import ( "runtime" "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/openstack/step_load_extensions.go b/builder/openstack/step_load_extensions.go index 84ab0c8d2..a7feec875 100644 --- a/builder/openstack/step_load_extensions.go +++ b/builder/openstack/step_load_extensions.go @@ -6,8 +6,8 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions" "github.com/gophercloud/gophercloud/pagination" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepLoadExtensions gets the FlavorRef from a Flavor. It first assumes diff --git a/builder/openstack/step_load_flavor.go b/builder/openstack/step_load_flavor.go index 816e0d8f4..ddc456681 100644 --- a/builder/openstack/step_load_flavor.go +++ b/builder/openstack/step_load_flavor.go @@ -5,8 +5,8 @@ import ( "log" "github.com/gophercloud/gophercloud/openstack/compute/v2/flavors" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepLoadFlavor gets the FlavorRef from a Flavor. It first assumes diff --git a/builder/openstack/step_run_source_server.go b/builder/openstack/step_run_source_server.go index 427f507dc..8b29357bb 100644 --- a/builder/openstack/step_run_source_server.go +++ b/builder/openstack/step_run_source_server.go @@ -7,8 +7,8 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepRunSourceServer struct { diff --git a/builder/openstack/step_stop_server.go b/builder/openstack/step_stop_server.go index e0f240fbd..48d1eb4d7 100644 --- a/builder/openstack/step_stop_server.go +++ b/builder/openstack/step_stop_server.go @@ -5,8 +5,8 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/startstop" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepStopServer struct{} diff --git a/builder/openstack/step_update_image_visibility.go b/builder/openstack/step_update_image_visibility.go index fb83134bd..d003f2894 100644 --- a/builder/openstack/step_update_image_visibility.go +++ b/builder/openstack/step_update_image_visibility.go @@ -4,8 +4,8 @@ import ( "fmt" imageservice "github.com/gophercloud/gophercloud/openstack/imageservice/v2/images" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepUpdateImageVisibility struct{} diff --git a/builder/openstack/step_wait_for_rackconnect.go b/builder/openstack/step_wait_for_rackconnect.go index d791e9db0..1b17a9d27 100644 --- a/builder/openstack/step_wait_for_rackconnect.go +++ b/builder/openstack/step_wait_for_rackconnect.go @@ -5,8 +5,8 @@ import ( "time" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepWaitForRackConnect struct { diff --git a/builder/oracle/oci/builder.go b/builder/oracle/oci/builder.go index 5eedaa0b1..6a2f6efef 100644 --- a/builder/oracle/oci/builder.go +++ b/builder/oracle/oci/builder.go @@ -9,8 +9,8 @@ import ( client "github.com/hashicorp/packer/builder/oracle/oci/client" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // BuilderId uniquely identifies the builder diff --git a/builder/oracle/oci/ssh.go b/builder/oracle/oci/ssh.go index a9d62f4a4..5424b94b4 100644 --- a/builder/oracle/oci/ssh.go +++ b/builder/oracle/oci/ssh.go @@ -4,7 +4,7 @@ import ( "fmt" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/oracle/oci/step_create_instance.go b/builder/oracle/oci/step_create_instance.go index 8650f7314..ad18a7e81 100644 --- a/builder/oracle/oci/step_create_instance.go +++ b/builder/oracle/oci/step_create_instance.go @@ -3,8 +3,8 @@ package oci import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepCreateInstance struct{} diff --git a/builder/oracle/oci/step_create_instance_test.go b/builder/oracle/oci/step_create_instance_test.go index 558a17cb6..3594281b6 100644 --- a/builder/oracle/oci/step_create_instance_test.go +++ b/builder/oracle/oci/step_create_instance_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateInstance(t *testing.T) { diff --git a/builder/oracle/oci/step_image.go b/builder/oracle/oci/step_image.go index 07c9ddb4b..b7ce54057 100644 --- a/builder/oracle/oci/step_image.go +++ b/builder/oracle/oci/step_image.go @@ -3,8 +3,8 @@ package oci import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepImage struct{} diff --git a/builder/oracle/oci/step_image_test.go b/builder/oracle/oci/step_image_test.go index 72399278c..e3e0e353c 100644 --- a/builder/oracle/oci/step_image_test.go +++ b/builder/oracle/oci/step_image_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepImage(t *testing.T) { diff --git a/builder/oracle/oci/step_instance_info.go b/builder/oracle/oci/step_instance_info.go index 310d8699c..df70434b0 100644 --- a/builder/oracle/oci/step_instance_info.go +++ b/builder/oracle/oci/step_instance_info.go @@ -3,8 +3,8 @@ package oci import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepInstanceInfo struct{} diff --git a/builder/oracle/oci/step_instance_info_test.go b/builder/oracle/oci/step_instance_info_test.go index fdae8a0ef..6280e3e6f 100644 --- a/builder/oracle/oci/step_instance_info_test.go +++ b/builder/oracle/oci/step_instance_info_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestInstanceInfo(t *testing.T) { diff --git a/builder/oracle/oci/step_ssh_key_pair.go b/builder/oracle/oci/step_ssh_key_pair.go index cc9d0358f..b7a89ae63 100644 --- a/builder/oracle/oci/step_ssh_key_pair.go +++ b/builder/oracle/oci/step_ssh_key_pair.go @@ -10,8 +10,8 @@ import ( "os" "runtime" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/oracle/oci/step_test.go b/builder/oracle/oci/step_test.go index d4436e304..f46ffa1e4 100644 --- a/builder/oracle/oci/step_test.go +++ b/builder/oracle/oci/step_test.go @@ -4,8 +4,8 @@ import ( "bytes" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" client "github.com/hashicorp/packer/builder/oracle/oci/client" ) diff --git a/builder/parallels/common/ssh.go b/builder/parallels/common/ssh.go index 8c2c8706f..6673698b5 100644 --- a/builder/parallels/common/ssh.go +++ b/builder/parallels/common/ssh.go @@ -3,7 +3,7 @@ package common import ( commonssh "github.com/hashicorp/packer/common/ssh" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/parallels/common/step_attach_floppy.go b/builder/parallels/common/step_attach_floppy.go index 8b970fef2..ec8a0663d 100644 --- a/builder/parallels/common/step_attach_floppy.go +++ b/builder/parallels/common/step_attach_floppy.go @@ -4,8 +4,8 @@ import ( "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepAttachFloppy is a step that attaches a floppy to the virtual machine. diff --git a/builder/parallels/common/step_attach_floppy_test.go b/builder/parallels/common/step_attach_floppy_test.go index f854fd23c..7df1c4569 100644 --- a/builder/parallels/common/step_attach_floppy_test.go +++ b/builder/parallels/common/step_attach_floppy_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepAttachFloppy_impl(t *testing.T) { diff --git a/builder/parallels/common/step_attach_parallels_tools.go b/builder/parallels/common/step_attach_parallels_tools.go index 87d602df7..3d7534960 100644 --- a/builder/parallels/common/step_attach_parallels_tools.go +++ b/builder/parallels/common/step_attach_parallels_tools.go @@ -4,8 +4,8 @@ import ( "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepAttachParallelsTools is a step that attaches Parallels Tools ISO image diff --git a/builder/parallels/common/step_compact_disk.go b/builder/parallels/common/step_compact_disk.go index 2e88e7bd5..a79cf9f7b 100644 --- a/builder/parallels/common/step_compact_disk.go +++ b/builder/parallels/common/step_compact_disk.go @@ -3,8 +3,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCompactDisk is a step that removes all empty blocks from expanding diff --git a/builder/parallels/common/step_compact_disk_test.go b/builder/parallels/common/step_compact_disk_test.go index ace932a2d..4b41c5f41 100644 --- a/builder/parallels/common/step_compact_disk_test.go +++ b/builder/parallels/common/step_compact_disk_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCompactDisk_impl(t *testing.T) { diff --git a/builder/parallels/common/step_output_dir.go b/builder/parallels/common/step_output_dir.go index 3accd2cbb..a3cb8db5a 100644 --- a/builder/parallels/common/step_output_dir.go +++ b/builder/parallels/common/step_output_dir.go @@ -7,8 +7,8 @@ import ( "path/filepath" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepOutputDir sets up the output directory by creating it if it does diff --git a/builder/parallels/common/step_output_dir_test.go b/builder/parallels/common/step_output_dir_test.go index 04f5a7339..3f6d83436 100644 --- a/builder/parallels/common/step_output_dir_test.go +++ b/builder/parallels/common/step_output_dir_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testStepOutputDir(t *testing.T) *StepOutputDir { diff --git a/builder/parallels/common/step_prepare_parallels_tools.go b/builder/parallels/common/step_prepare_parallels_tools.go index 99e8722dc..174274b3d 100644 --- a/builder/parallels/common/step_prepare_parallels_tools.go +++ b/builder/parallels/common/step_prepare_parallels_tools.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // StepPrepareParallelsTools is a step that prepares parameters related diff --git a/builder/parallels/common/step_prepare_parallels_tools_test.go b/builder/parallels/common/step_prepare_parallels_tools_test.go index 0647149e5..f0542c41d 100644 --- a/builder/parallels/common/step_prepare_parallels_tools_test.go +++ b/builder/parallels/common/step_prepare_parallels_tools_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepPrepareParallelsTools_impl(t *testing.T) { diff --git a/builder/parallels/common/step_prlctl.go b/builder/parallels/common/step_prlctl.go index a38d8b7fe..b93b396f0 100644 --- a/builder/parallels/common/step_prlctl.go +++ b/builder/parallels/common/step_prlctl.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type commandTemplate struct { diff --git a/builder/parallels/common/step_run.go b/builder/parallels/common/step_run.go index 8f86e089b..38ca6269b 100644 --- a/builder/parallels/common/step_run.go +++ b/builder/parallels/common/step_run.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepRun is a step that starts the virtual machine. diff --git a/builder/parallels/common/step_shutdown.go b/builder/parallels/common/step_shutdown.go index f8ec90009..0eaaff454 100644 --- a/builder/parallels/common/step_shutdown.go +++ b/builder/parallels/common/step_shutdown.go @@ -7,8 +7,8 @@ import ( "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepShutdown is a step that shuts down the machine. It first attempts to do diff --git a/builder/parallels/common/step_shutdown_test.go b/builder/parallels/common/step_shutdown_test.go index de3baabda..ef8dea7e0 100644 --- a/builder/parallels/common/step_shutdown_test.go +++ b/builder/parallels/common/step_shutdown_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepShutdown_impl(t *testing.T) { diff --git a/builder/parallels/common/step_test.go b/builder/parallels/common/step_test.go index cdaab7922..0964784f7 100644 --- a/builder/parallels/common/step_test.go +++ b/builder/parallels/common/step_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/parallels/common/step_type_boot_command.go b/builder/parallels/common/step_type_boot_command.go index c3076b82c..454b726db 100644 --- a/builder/parallels/common/step_type_boot_command.go +++ b/builder/parallels/common/step_type_boot_command.go @@ -9,9 +9,9 @@ import ( "unicode/utf8" packer_common "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type bootCommandTemplateData struct { diff --git a/builder/parallels/common/step_type_boot_command_test.go b/builder/parallels/common/step_type_boot_command_test.go index ea33b9369..559241c60 100644 --- a/builder/parallels/common/step_type_boot_command_test.go +++ b/builder/parallels/common/step_type_boot_command_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepTypeBootCommand(t *testing.T) { diff --git a/builder/parallels/common/step_upload_parallels_tools.go b/builder/parallels/common/step_upload_parallels_tools.go index 5769f1be5..f40a601b6 100644 --- a/builder/parallels/common/step_upload_parallels_tools.go +++ b/builder/parallels/common/step_upload_parallels_tools.go @@ -5,9 +5,9 @@ import ( "log" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // This step uploads the Parallels Tools ISO to the virtual machine. diff --git a/builder/parallels/common/step_upload_parallels_tools_test.go b/builder/parallels/common/step_upload_parallels_tools_test.go index 263571ff6..7e2f92110 100644 --- a/builder/parallels/common/step_upload_parallels_tools_test.go +++ b/builder/parallels/common/step_upload_parallels_tools_test.go @@ -3,8 +3,8 @@ package common import ( "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepUploadParallelsTools_impl(t *testing.T) { diff --git a/builder/parallels/common/step_upload_version.go b/builder/parallels/common/step_upload_version.go index 6824b035e..871f98400 100644 --- a/builder/parallels/common/step_upload_version.go +++ b/builder/parallels/common/step_upload_version.go @@ -5,8 +5,8 @@ import ( "fmt" "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepUploadVersion is a step that uploads a file containing the version of diff --git a/builder/parallels/common/step_upload_version_test.go b/builder/parallels/common/step_upload_version_test.go index 8aaf9cc90..17609b9aa 100644 --- a/builder/parallels/common/step_upload_version_test.go +++ b/builder/parallels/common/step_upload_version_test.go @@ -3,8 +3,8 @@ package common import ( "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepUploadVersion_impl(t *testing.T) { diff --git a/builder/parallels/iso/builder.go b/builder/parallels/iso/builder.go index 14ae2991d..cf8159f6b 100644 --- a/builder/parallels/iso/builder.go +++ b/builder/parallels/iso/builder.go @@ -9,9 +9,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderId = "rickard-von-essen.parallels" diff --git a/builder/parallels/iso/step_attach_iso.go b/builder/parallels/iso/step_attach_iso.go index 4dead4705..2ce5c7387 100644 --- a/builder/parallels/iso/step_attach_iso.go +++ b/builder/parallels/iso/step_attach_iso.go @@ -5,8 +5,8 @@ import ( "log" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step attaches the ISO to the virtual machine. diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index 0333472be..e7814507e 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -5,8 +5,8 @@ import ( "strconv" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates the virtual disk that will be used as the diff --git a/builder/parallels/iso/step_create_vm.go b/builder/parallels/iso/step_create_vm.go index b085e4485..0349931fa 100644 --- a/builder/parallels/iso/step_create_vm.go +++ b/builder/parallels/iso/step_create_vm.go @@ -4,8 +4,8 @@ import ( "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates the actual virtual machine. diff --git a/builder/parallels/iso/step_set_boot_order.go b/builder/parallels/iso/step_set_boot_order.go index a32249173..5b6837919 100644 --- a/builder/parallels/iso/step_set_boot_order.go +++ b/builder/parallels/iso/step_set_boot_order.go @@ -4,8 +4,8 @@ import ( "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step sets the device boot order for the virtual machine. diff --git a/builder/parallels/pvm/builder.go b/builder/parallels/pvm/builder.go index 5db72bbaa..1e0d3c49a 100644 --- a/builder/parallels/pvm/builder.go +++ b/builder/parallels/pvm/builder.go @@ -8,8 +8,8 @@ import ( parallelscommon "github.com/hashicorp/packer/builder/parallels/common" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // Builder implements packer.Builder and builds the actual Parallels diff --git a/builder/parallels/pvm/step_import.go b/builder/parallels/pvm/step_import.go index 91b8878af..d2b49f136 100644 --- a/builder/parallels/pvm/step_import.go +++ b/builder/parallels/pvm/step_import.go @@ -4,8 +4,8 @@ import ( "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step imports an PVM VM into Parallels. diff --git a/builder/parallels/pvm/step_test.go b/builder/parallels/pvm/step_test.go index 827850a35..9d891c637 100644 --- a/builder/parallels/pvm/step_test.go +++ b/builder/parallels/pvm/step_test.go @@ -5,8 +5,8 @@ import ( "testing" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/profitbricks/builder.go b/builder/profitbricks/builder.go index 42dc148d3..fc7734a07 100644 --- a/builder/profitbricks/builder.go +++ b/builder/profitbricks/builder.go @@ -6,8 +6,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) const BuilderId = "packer.profitbricks" diff --git a/builder/profitbricks/ssh.go b/builder/profitbricks/ssh.go index 3b0c93f31..d56696330 100644 --- a/builder/profitbricks/ssh.go +++ b/builder/profitbricks/ssh.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/profitbricks/step_create_server.go b/builder/profitbricks/step_create_server.go index a4de3cb19..3d2145e27 100644 --- a/builder/profitbricks/step_create_server.go +++ b/builder/profitbricks/step_create_server.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/profitbricks/profitbricks-sdk-go" ) diff --git a/builder/profitbricks/step_create_ssh_key.go b/builder/profitbricks/step_create_ssh_key.go index 963afdf8c..26343d8a1 100644 --- a/builder/profitbricks/step_create_ssh_key.go +++ b/builder/profitbricks/step_create_ssh_key.go @@ -4,10 +4,8 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "golang.org/x/crypto/ssh" ) diff --git a/builder/profitbricks/step_take_snapshot.go b/builder/profitbricks/step_take_snapshot.go index 822ea8699..31e22a379 100644 --- a/builder/profitbricks/step_take_snapshot.go +++ b/builder/profitbricks/step_take_snapshot.go @@ -4,8 +4,8 @@ import ( "encoding/json" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/profitbricks/profitbricks-sdk-go" ) diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go index 43ec6b4c3..e926e3a17 100644 --- a/builder/qemu/builder.go +++ b/builder/qemu/builder.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderId = "transcend.qemu" diff --git a/builder/qemu/driver.go b/builder/qemu/driver.go index 632490114..eb1992ba6 100644 --- a/builder/qemu/driver.go +++ b/builder/qemu/driver.go @@ -14,7 +14,7 @@ import ( "time" "unicode" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) type DriverCancelCallback func(state multistep.StateBag) bool diff --git a/builder/qemu/ssh.go b/builder/qemu/ssh.go index 1881613fd..9c565eb32 100644 --- a/builder/qemu/ssh.go +++ b/builder/qemu/ssh.go @@ -3,7 +3,7 @@ package qemu import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/qemu/step_boot_wait.go b/builder/qemu/step_boot_wait.go index 36625b8df..71d166689 100644 --- a/builder/qemu/step_boot_wait.go +++ b/builder/qemu/step_boot_wait.go @@ -2,10 +2,9 @@ package qemu import ( "fmt" - "time" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "time" ) // stepBootWait waits the configured time period. diff --git a/builder/qemu/step_configure_vnc.go b/builder/qemu/step_configure_vnc.go index 2cbfd6820..4224e2f33 100644 --- a/builder/qemu/step_configure_vnc.go +++ b/builder/qemu/step_configure_vnc.go @@ -6,8 +6,8 @@ import ( "math/rand" "net" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step configures the VM to enable the VNC server. diff --git a/builder/qemu/step_convert_disk.go b/builder/qemu/step_convert_disk.go index db7fe52c3..f74dc75d4 100644 --- a/builder/qemu/step_convert_disk.go +++ b/builder/qemu/step_convert_disk.go @@ -4,8 +4,8 @@ import ( "fmt" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "os" ) diff --git a/builder/qemu/step_copy_disk.go b/builder/qemu/step_copy_disk.go index 633d8d6b8..d60c10dec 100644 --- a/builder/qemu/step_copy_disk.go +++ b/builder/qemu/step_copy_disk.go @@ -4,8 +4,8 @@ import ( "fmt" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step copies the virtual disk that will be used as the diff --git a/builder/qemu/step_create_disk.go b/builder/qemu/step_create_disk.go index 5d844e2a0..ab0250e9b 100644 --- a/builder/qemu/step_create_disk.go +++ b/builder/qemu/step_create_disk.go @@ -4,8 +4,8 @@ import ( "fmt" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates the virtual disk that will be used as the diff --git a/builder/qemu/step_forward_ssh.go b/builder/qemu/step_forward_ssh.go index 7737fcbd8..ec1e9e18b 100644 --- a/builder/qemu/step_forward_ssh.go +++ b/builder/qemu/step_forward_ssh.go @@ -6,8 +6,8 @@ import ( "math/rand" "net" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step adds a NAT port forwarding definition so that SSH is available diff --git a/builder/qemu/step_prepare_output_dir.go b/builder/qemu/step_prepare_output_dir.go index b5f96c5ca..019e99bec 100644 --- a/builder/qemu/step_prepare_output_dir.go +++ b/builder/qemu/step_prepare_output_dir.go @@ -1,6 +1,8 @@ package qemu import ( + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "os" "time" diff --git a/builder/qemu/step_resize_disk.go b/builder/qemu/step_resize_disk.go index fbbd8d572..a6bc96487 100644 --- a/builder/qemu/step_resize_disk.go +++ b/builder/qemu/step_resize_disk.go @@ -4,8 +4,8 @@ import ( "fmt" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step resizes the virtual disk that will be used as the diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index dc9dd2faa..a9b00798e 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -7,9 +7,9 @@ import ( "strconv" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) // stepRun runs the virtual machine diff --git a/builder/qemu/step_set_iso.go b/builder/qemu/step_set_iso.go index f32a2687b..ff0f03b5b 100644 --- a/builder/qemu/step_set_iso.go +++ b/builder/qemu/step_set_iso.go @@ -4,8 +4,8 @@ import ( "fmt" "net/http" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step set iso_patch to available url diff --git a/builder/qemu/step_shutdown.go b/builder/qemu/step_shutdown.go index 88fa42c34..4efd85892 100644 --- a/builder/qemu/step_shutdown.go +++ b/builder/qemu/step_shutdown.go @@ -6,8 +6,8 @@ import ( "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step shuts down the machine. It first attempts to do so gracefully, diff --git a/builder/qemu/step_type_boot_command.go b/builder/qemu/step_type_boot_command.go index 97e05b7ea..fb0985d13 100644 --- a/builder/qemu/step_type_boot_command.go +++ b/builder/qemu/step_type_boot_command.go @@ -13,10 +13,11 @@ import ( "os" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" "github.com/mitchellh/go-vnc" - "github.com/mitchellh/multistep" + "os" ) const KeyLeftShift uint32 = 0xFFE1 diff --git a/builder/triton/builder.go b/builder/triton/builder.go index 3e572e0a4..f2937a702 100644 --- a/builder/triton/builder.go +++ b/builder/triton/builder.go @@ -7,8 +7,8 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/triton/ssh.go b/builder/triton/ssh.go index 14fd26e31..179b94215 100644 --- a/builder/triton/ssh.go +++ b/builder/triton/ssh.go @@ -9,7 +9,7 @@ import ( "os" packerssh "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) diff --git a/builder/triton/step_create_image_from_machine.go b/builder/triton/step_create_image_from_machine.go index 76c46a768..cbda57e0b 100644 --- a/builder/triton/step_create_image_from_machine.go +++ b/builder/triton/step_create_image_from_machine.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateImageFromMachine creates an image with the specified attributes diff --git a/builder/triton/step_create_image_from_machine_test.go b/builder/triton/step_create_image_from_machine_test.go index 36ee43f82..9af18e44f 100644 --- a/builder/triton/step_create_image_from_machine_test.go +++ b/builder/triton/step_create_image_from_machine_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateImageFromMachine(t *testing.T) { diff --git a/builder/triton/step_create_source_machine.go b/builder/triton/step_create_source_machine.go index ae51fc60e..a52d35e50 100644 --- a/builder/triton/step_create_source_machine.go +++ b/builder/triton/step_create_source_machine.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCreateSourceMachine creates an machine with the specified attributes diff --git a/builder/triton/step_create_source_machine_test.go b/builder/triton/step_create_source_machine_test.go index 56f5d5940..f7101564a 100644 --- a/builder/triton/step_create_source_machine_test.go +++ b/builder/triton/step_create_source_machine_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCreateSourceMachine(t *testing.T) { diff --git a/builder/triton/step_delete_machine.go b/builder/triton/step_delete_machine.go index d766f9833..bccb791df 100644 --- a/builder/triton/step_delete_machine.go +++ b/builder/triton/step_delete_machine.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepDeleteMachine deletes the machine with the ID specified in state["machine"] diff --git a/builder/triton/step_delete_machine_test.go b/builder/triton/step_delete_machine_test.go index bca82b89a..a2177ca36 100644 --- a/builder/triton/step_delete_machine_test.go +++ b/builder/triton/step_delete_machine_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDeleteMachine(t *testing.T) { diff --git a/builder/triton/step_stop_machine.go b/builder/triton/step_stop_machine.go index 00eb75958..4c2ab0d63 100644 --- a/builder/triton/step_stop_machine.go +++ b/builder/triton/step_stop_machine.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepStopMachine stops the machine with the given Machine ID, and waits diff --git a/builder/triton/step_stop_machine_test.go b/builder/triton/step_stop_machine_test.go index 4609343e0..9604c2216 100644 --- a/builder/triton/step_stop_machine_test.go +++ b/builder/triton/step_stop_machine_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepStopMachine(t *testing.T) { diff --git a/builder/triton/step_test.go b/builder/triton/step_test.go index fe647b42f..00fef044a 100644 --- a/builder/triton/step_test.go +++ b/builder/triton/step_test.go @@ -2,10 +2,9 @@ package triton import ( "bytes" - "testing" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/triton/step_wait_for_stop_to_not_fail.go b/builder/triton/step_wait_for_stop_to_not_fail.go index cd4df4704..d5479c803 100644 --- a/builder/triton/step_wait_for_stop_to_not_fail.go +++ b/builder/triton/step_wait_for_stop_to_not_fail.go @@ -3,8 +3,8 @@ package triton import ( "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepWaitForStopNotToFail waits for 10 seconds before returning with continue diff --git a/builder/virtualbox/common/ssh.go b/builder/virtualbox/common/ssh.go index b09c0cc47..45a99fb29 100644 --- a/builder/virtualbox/common/ssh.go +++ b/builder/virtualbox/common/ssh.go @@ -3,7 +3,7 @@ package common import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/virtualbox/common/step_attach_floppy.go b/builder/virtualbox/common/step_attach_floppy.go index 35c8d1822..068f7814c 100644 --- a/builder/virtualbox/common/step_attach_floppy.go +++ b/builder/virtualbox/common/step_attach_floppy.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "io" "io/ioutil" "log" diff --git a/builder/virtualbox/common/step_attach_floppy_test.go b/builder/virtualbox/common/step_attach_floppy_test.go index 93d62b6d8..85f8ca0c2 100644 --- a/builder/virtualbox/common/step_attach_floppy_test.go +++ b/builder/virtualbox/common/step_attach_floppy_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" diff --git a/builder/virtualbox/common/step_attach_guest_additions.go b/builder/virtualbox/common/step_attach_guest_additions.go index 0d883f817..d9e43e820 100644 --- a/builder/virtualbox/common/step_attach_guest_additions.go +++ b/builder/virtualbox/common/step_attach_guest_additions.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // This step attaches the VirtualBox guest additions as a inserted CD onto diff --git a/builder/virtualbox/common/step_configure_vrdp.go b/builder/virtualbox/common/step_configure_vrdp.go index 9a966c508..aa47d586d 100644 --- a/builder/virtualbox/common/step_configure_vrdp.go +++ b/builder/virtualbox/common/step_configure_vrdp.go @@ -6,8 +6,8 @@ import ( "math/rand" "net" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step configures the VM to enable the VRDP server diff --git a/builder/virtualbox/common/step_download_guest_additions.go b/builder/virtualbox/common/step_download_guest_additions.go index 93f3952c2..498d2e71e 100644 --- a/builder/virtualbox/common/step_download_guest_additions.go +++ b/builder/virtualbox/common/step_download_guest_additions.go @@ -10,9 +10,9 @@ import ( "strings" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) var additionsVersionMap = map[string]string{ diff --git a/builder/virtualbox/common/step_export.go b/builder/virtualbox/common/step_export.go index dab7d9ac3..268634132 100644 --- a/builder/virtualbox/common/step_export.go +++ b/builder/virtualbox/common/step_export.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "path/filepath" "strings" diff --git a/builder/virtualbox/common/step_export_test.go b/builder/virtualbox/common/step_export_test.go index 30723bae7..fee2cafdb 100644 --- a/builder/virtualbox/common/step_export_test.go +++ b/builder/virtualbox/common/step_export_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/virtualbox/common/step_forward_ssh.go b/builder/virtualbox/common/step_forward_ssh.go index 391573ced..7b0a6f903 100644 --- a/builder/virtualbox/common/step_forward_ssh.go +++ b/builder/virtualbox/common/step_forward_ssh.go @@ -7,8 +7,8 @@ import ( "net" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step adds a NAT port forwarding definition so that SSH is available diff --git a/builder/virtualbox/common/step_output_dir.go b/builder/virtualbox/common/step_output_dir.go index 0054d1994..acb905e9a 100644 --- a/builder/virtualbox/common/step_output_dir.go +++ b/builder/virtualbox/common/step_output_dir.go @@ -7,8 +7,8 @@ import ( "path/filepath" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepOutputDir sets up the output directory by creating it if it does diff --git a/builder/virtualbox/common/step_output_dir_test.go b/builder/virtualbox/common/step_output_dir_test.go index c742b5ddd..48f4634f4 100644 --- a/builder/virtualbox/common/step_output_dir_test.go +++ b/builder/virtualbox/common/step_output_dir_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" diff --git a/builder/virtualbox/common/step_remove_devices.go b/builder/virtualbox/common/step_remove_devices.go index 7860d53e9..0cdde2f23 100644 --- a/builder/virtualbox/common/step_remove_devices.go +++ b/builder/virtualbox/common/step_remove_devices.go @@ -5,8 +5,8 @@ import ( "log" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step removes any devices (floppy disks, ISOs, etc.) from the diff --git a/builder/virtualbox/common/step_remove_devices_test.go b/builder/virtualbox/common/step_remove_devices_test.go index 705648e33..9a2e8ee3a 100644 --- a/builder/virtualbox/common/step_remove_devices_test.go +++ b/builder/virtualbox/common/step_remove_devices_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/virtualbox/common/step_run.go b/builder/virtualbox/common/step_run.go index 3019c57d6..fc9ee9359 100644 --- a/builder/virtualbox/common/step_run.go +++ b/builder/virtualbox/common/step_run.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step starts the virtual machine. diff --git a/builder/virtualbox/common/step_shutdown.go b/builder/virtualbox/common/step_shutdown.go index 11a7cb3ac..51c435853 100644 --- a/builder/virtualbox/common/step_shutdown.go +++ b/builder/virtualbox/common/step_shutdown.go @@ -3,6 +3,8 @@ package common import ( "errors" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "time" diff --git a/builder/virtualbox/common/step_shutdown_test.go b/builder/virtualbox/common/step_shutdown_test.go index f83c65a8d..aa36a6c91 100644 --- a/builder/virtualbox/common/step_shutdown_test.go +++ b/builder/virtualbox/common/step_shutdown_test.go @@ -1,6 +1,8 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "testing" "time" diff --git a/builder/virtualbox/common/step_suppress_messages.go b/builder/virtualbox/common/step_suppress_messages.go index d6b2dcbbe..6ccbe0434 100644 --- a/builder/virtualbox/common/step_suppress_messages.go +++ b/builder/virtualbox/common/step_suppress_messages.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // This step sets some variables in VirtualBox so that annoying diff --git a/builder/virtualbox/common/step_suppress_messages_test.go b/builder/virtualbox/common/step_suppress_messages_test.go index 69c947835..d5609d456 100644 --- a/builder/virtualbox/common/step_suppress_messages_test.go +++ b/builder/virtualbox/common/step_suppress_messages_test.go @@ -2,6 +2,7 @@ package common import ( "errors" + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/virtualbox/common/step_test.go b/builder/virtualbox/common/step_test.go index 140f6f619..ec0854415 100644 --- a/builder/virtualbox/common/step_test.go +++ b/builder/virtualbox/common/step_test.go @@ -2,10 +2,9 @@ package common import ( "bytes" - "testing" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/virtualbox/common/step_type_boot_command.go b/builder/virtualbox/common/step_type_boot_command.go index 3220ca8b8..ba008a5a3 100644 --- a/builder/virtualbox/common/step_type_boot_command.go +++ b/builder/virtualbox/common/step_type_boot_command.go @@ -9,9 +9,9 @@ import ( "unicode/utf8" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const KeyLeftShift uint32 = 0xFFE1 diff --git a/builder/virtualbox/common/step_upload_guest_additions.go b/builder/virtualbox/common/step_upload_guest_additions.go index a98676555..12b646e7e 100644 --- a/builder/virtualbox/common/step_upload_guest_additions.go +++ b/builder/virtualbox/common/step_upload_guest_additions.go @@ -5,9 +5,9 @@ import ( "log" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type guestAdditionsPathTemplate struct { diff --git a/builder/virtualbox/common/step_upload_version.go b/builder/virtualbox/common/step_upload_version.go index c9481c49b..262b6bfad 100644 --- a/builder/virtualbox/common/step_upload_version.go +++ b/builder/virtualbox/common/step_upload_version.go @@ -3,10 +3,9 @@ package common import ( "bytes" "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // This step uploads a file containing the VirtualBox version, which diff --git a/builder/virtualbox/common/step_upload_version_test.go b/builder/virtualbox/common/step_upload_version_test.go index 8aaf9cc90..cfd940a4b 100644 --- a/builder/virtualbox/common/step_upload_version_test.go +++ b/builder/virtualbox/common/step_upload_version_test.go @@ -1,10 +1,9 @@ package common import ( - "testing" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func TestStepUploadVersion_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_vboxmanage.go b/builder/virtualbox/common/step_vboxmanage.go index 7544dbbce..2366cc6ef 100644 --- a/builder/virtualbox/common/step_vboxmanage.go +++ b/builder/virtualbox/common/step_vboxmanage.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type commandTemplate struct { diff --git a/builder/virtualbox/iso/builder.go b/builder/virtualbox/iso/builder.go index 82cf36409..0d1be21dd 100644 --- a/builder/virtualbox/iso/builder.go +++ b/builder/virtualbox/iso/builder.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderId = "mitchellh.virtualbox" diff --git a/builder/virtualbox/iso/step_attach_iso.go b/builder/virtualbox/iso/step_attach_iso.go index 1eb87ff92..088241e58 100644 --- a/builder/virtualbox/iso/step_attach_iso.go +++ b/builder/virtualbox/iso/step_attach_iso.go @@ -4,8 +4,8 @@ import ( "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step attaches the ISO to the virtual machine. diff --git a/builder/virtualbox/iso/step_create_disk.go b/builder/virtualbox/iso/step_create_disk.go index 6051768af..c5eb71302 100644 --- a/builder/virtualbox/iso/step_create_disk.go +++ b/builder/virtualbox/iso/step_create_disk.go @@ -4,8 +4,8 @@ import ( "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "path/filepath" "strconv" diff --git a/builder/virtualbox/iso/step_create_vm.go b/builder/virtualbox/iso/step_create_vm.go index ad1f72eaf..1f14d5b1a 100644 --- a/builder/virtualbox/iso/step_create_vm.go +++ b/builder/virtualbox/iso/step_create_vm.go @@ -4,8 +4,8 @@ import ( "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates the actual virtual machine. diff --git a/builder/virtualbox/ovf/builder.go b/builder/virtualbox/ovf/builder.go index 475bbebcf..d9783244f 100644 --- a/builder/virtualbox/ovf/builder.go +++ b/builder/virtualbox/ovf/builder.go @@ -8,8 +8,8 @@ import ( vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // Builder implements packer.Builder and builds the actual VirtualBox diff --git a/builder/virtualbox/ovf/step_import.go b/builder/virtualbox/ovf/step_import.go index 33e71fc24..ca52ef9fc 100644 --- a/builder/virtualbox/ovf/step_import.go +++ b/builder/virtualbox/ovf/step_import.go @@ -4,8 +4,8 @@ import ( "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step imports an OVF VM into VirtualBox. diff --git a/builder/virtualbox/ovf/step_import_test.go b/builder/virtualbox/ovf/step_import_test.go index dcaf013b5..aec090980 100644 --- a/builder/virtualbox/ovf/step_import_test.go +++ b/builder/virtualbox/ovf/step_import_test.go @@ -4,7 +4,8 @@ import ( "testing" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" + "testing" ) func TestStepImport_impl(t *testing.T) { diff --git a/builder/virtualbox/ovf/step_test.go b/builder/virtualbox/ovf/step_test.go index 805d435bc..eb6522ef6 100644 --- a/builder/virtualbox/ovf/step_test.go +++ b/builder/virtualbox/ovf/step_test.go @@ -5,8 +5,9 @@ import ( "testing" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/common/driver.go b/builder/vmware/common/driver.go index 4e4f38e02..99c9f686c 100644 --- a/builder/vmware/common/driver.go +++ b/builder/vmware/common/driver.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // A driver is able to talk to VMware, control virtual machines, etc. diff --git a/builder/vmware/common/driver_fusion5.go b/builder/vmware/common/driver_fusion5.go index a10f11902..9545d3e81 100644 --- a/builder/vmware/common/driver_fusion5.go +++ b/builder/vmware/common/driver_fusion5.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // Fusion5Driver is a driver that can run VMware Fusion 5. diff --git a/builder/vmware/common/driver_mock.go b/builder/vmware/common/driver_mock.go index fcd80a51b..9291be976 100644 --- a/builder/vmware/common/driver_mock.go +++ b/builder/vmware/common/driver_mock.go @@ -3,7 +3,7 @@ package common import ( "sync" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) type DriverMock struct { diff --git a/builder/vmware/common/driver_player5.go b/builder/vmware/common/driver_player5.go index 1552e92ea..311e5019c 100644 --- a/builder/vmware/common/driver_player5.go +++ b/builder/vmware/common/driver_player5.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // Player5Driver is a driver that can run VMware Player 5 on Linux. diff --git a/builder/vmware/common/driver_workstation9.go b/builder/vmware/common/driver_workstation9.go index debcefcbc..d870a4cda 100644 --- a/builder/vmware/common/driver_workstation9.go +++ b/builder/vmware/common/driver_workstation9.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) // Workstation9Driver is a driver that can run VMware Workstation 9 diff --git a/builder/vmware/common/ssh.go b/builder/vmware/common/ssh.go index 0d94599f8..871ba8df9 100644 --- a/builder/vmware/common/ssh.go +++ b/builder/vmware/common/ssh.go @@ -9,7 +9,7 @@ import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/vmware/common/step_clean_files.go b/builder/vmware/common/step_clean_files.go index b6d81293f..d1a970f36 100644 --- a/builder/vmware/common/step_clean_files.go +++ b/builder/vmware/common/step_clean_files.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "os" "path/filepath" diff --git a/builder/vmware/common/step_clean_vmx.go b/builder/vmware/common/step_clean_vmx.go index 853233e89..af29ae970 100644 --- a/builder/vmware/common/step_clean_vmx.go +++ b/builder/vmware/common/step_clean_vmx.go @@ -6,8 +6,8 @@ import ( "regexp" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step cleans up the VMX by removing or changing this prior to diff --git a/builder/vmware/common/step_clean_vmx_test.go b/builder/vmware/common/step_clean_vmx_test.go index aad39e8b0..04b2da1f5 100644 --- a/builder/vmware/common/step_clean_vmx_test.go +++ b/builder/vmware/common/step_clean_vmx_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCleanVMX_impl(t *testing.T) { diff --git a/builder/vmware/common/step_compact_disk.go b/builder/vmware/common/step_compact_disk.go index b53dd14c3..9292c46cf 100644 --- a/builder/vmware/common/step_compact_disk.go +++ b/builder/vmware/common/step_compact_disk.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // This step compacts the virtual disk for the VM unless the "skip_compaction" diff --git a/builder/vmware/common/step_compact_disk_test.go b/builder/vmware/common/step_compact_disk_test.go index e59a99a90..982191a4d 100644 --- a/builder/vmware/common/step_compact_disk_test.go +++ b/builder/vmware/common/step_compact_disk_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCompactDisk_impl(t *testing.T) { diff --git a/builder/vmware/common/step_configure_vmx.go b/builder/vmware/common/step_configure_vmx.go index 854922a2c..2b3f605f8 100644 --- a/builder/vmware/common/step_configure_vmx.go +++ b/builder/vmware/common/step_configure_vmx.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step configures a VMX by setting some default settings as well diff --git a/builder/vmware/common/step_configure_vmx_test.go b/builder/vmware/common/step_configure_vmx_test.go index 293269e3f..6bd692caa 100644 --- a/builder/vmware/common/step_configure_vmx_test.go +++ b/builder/vmware/common/step_configure_vmx_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testVMXFile(t *testing.T) string { diff --git a/builder/vmware/common/step_configure_vnc.go b/builder/vmware/common/step_configure_vnc.go index 4e4798862..e8b9f9a9f 100644 --- a/builder/vmware/common/step_configure_vnc.go +++ b/builder/vmware/common/step_configure_vnc.go @@ -8,8 +8,8 @@ import ( "net" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step configures the VM to enable the VNC server. diff --git a/builder/vmware/common/step_output_dir.go b/builder/vmware/common/step_output_dir.go index 2b679f1fc..ed180ed11 100644 --- a/builder/vmware/common/step_output_dir.go +++ b/builder/vmware/common/step_output_dir.go @@ -5,8 +5,8 @@ import ( "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepOutputDir sets up the output directory by creating it if it does diff --git a/builder/vmware/common/step_output_dir_test.go b/builder/vmware/common/step_output_dir_test.go index e748578bd..cdfba2a2e 100644 --- a/builder/vmware/common/step_output_dir_test.go +++ b/builder/vmware/common/step_output_dir_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" diff --git a/builder/vmware/common/step_prepare_tools.go b/builder/vmware/common/step_prepare_tools.go index f0566d91e..6dfabc663 100644 --- a/builder/vmware/common/step_prepare_tools.go +++ b/builder/vmware/common/step_prepare_tools.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) type StepPrepareTools struct { diff --git a/builder/vmware/common/step_prepare_tools_test.go b/builder/vmware/common/step_prepare_tools_test.go index 0326ea0d2..3ef593e5f 100644 --- a/builder/vmware/common/step_prepare_tools_test.go +++ b/builder/vmware/common/step_prepare_tools_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepPrepareTools_impl(t *testing.T) { diff --git a/builder/vmware/common/step_run.go b/builder/vmware/common/step_run.go index 2ea61f899..0324937fb 100644 --- a/builder/vmware/common/step_run.go +++ b/builder/vmware/common/step_run.go @@ -4,8 +4,8 @@ import ( "fmt" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step runs the created virtual machine. diff --git a/builder/vmware/common/step_run_test.go b/builder/vmware/common/step_run_test.go index 9888cdf10..961363a04 100644 --- a/builder/vmware/common/step_run_test.go +++ b/builder/vmware/common/step_run_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepRun_impl(t *testing.T) { diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index f0cf04aaf..2938eabe4 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -4,6 +4,8 @@ import ( "bytes" "errors" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "regexp" "strings" diff --git a/builder/vmware/common/step_shutdown_test.go b/builder/vmware/common/step_shutdown_test.go index b693527da..dd4693348 100644 --- a/builder/vmware/common/step_shutdown_test.go +++ b/builder/vmware/common/step_shutdown_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func testStepShutdownState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/common/step_suppress_messages.go b/builder/vmware/common/step_suppress_messages.go index a0a77b9ab..425da1398 100644 --- a/builder/vmware/common/step_suppress_messages.go +++ b/builder/vmware/common/step_suppress_messages.go @@ -2,10 +2,9 @@ package common import ( "fmt" - "log" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // This step suppresses any messages that VMware product might show. diff --git a/builder/vmware/common/step_suppress_messages_test.go b/builder/vmware/common/step_suppress_messages_test.go index 998cfdb24..a76b365a3 100644 --- a/builder/vmware/common/step_suppress_messages_test.go +++ b/builder/vmware/common/step_suppress_messages_test.go @@ -3,7 +3,7 @@ package common import ( "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepSuppressMessages_impl(t *testing.T) { diff --git a/builder/vmware/common/step_test.go b/builder/vmware/common/step_test.go index 140f6f619..ec0854415 100644 --- a/builder/vmware/common/step_test.go +++ b/builder/vmware/common/step_test.go @@ -2,10 +2,9 @@ package common import ( "bytes" - "testing" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/common/step_type_boot_command.go b/builder/vmware/common/step_type_boot_command.go index 28db3c72e..84b47045e 100644 --- a/builder/vmware/common/step_type_boot_command.go +++ b/builder/vmware/common/step_type_boot_command.go @@ -12,10 +12,10 @@ import ( "unicode/utf8" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" "github.com/mitchellh/go-vnc" - "github.com/mitchellh/multistep" ) const KeyLeftShift uint32 = 0xFFE1 diff --git a/builder/vmware/common/step_upload_tools.go b/builder/vmware/common/step_upload_tools.go index dfa8fcb88..c3642a1e6 100644 --- a/builder/vmware/common/step_upload_tools.go +++ b/builder/vmware/common/step_upload_tools.go @@ -4,9 +4,9 @@ import ( "fmt" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type toolsUploadPathTemplate struct { diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index 5fa15317f..1d2a29ac5 100644 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const BuilderIdESX = "mitchellh.vmware-esx" diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 8da66f0d2..f30451c65 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -16,8 +16,8 @@ import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/builder/vmware/iso/driver_esx5_test.go b/builder/vmware/iso/driver_esx5_test.go index 6ce714ff1..0c0ef757e 100644 --- a/builder/vmware/iso/driver_esx5_test.go +++ b/builder/vmware/iso/driver_esx5_test.go @@ -6,7 +6,7 @@ import ( "testing" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestESX5Driver_implDriver(t *testing.T) { diff --git a/builder/vmware/iso/step_create_disk.go b/builder/vmware/iso/step_create_disk.go index 0985b70e5..1d76e68f5 100644 --- a/builder/vmware/iso/step_create_disk.go +++ b/builder/vmware/iso/step_create_disk.go @@ -5,8 +5,9 @@ import ( "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "path/filepath" ) // This step creates the virtual disks for the VM. diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index 1f4ee812f..3a8985394 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -7,9 +7,9 @@ import ( "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type vmxTemplateData struct { diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index 91a2ce486..3fa71d8d8 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -9,8 +9,8 @@ import ( "runtime" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepExport struct { diff --git a/builder/vmware/iso/step_export_test.go b/builder/vmware/iso/step_export_test.go index 1e5ba606d..a713620e6 100644 --- a/builder/vmware/iso/step_export_test.go +++ b/builder/vmware/iso/step_export_test.go @@ -1,6 +1,7 @@ package iso import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/vmware/iso/step_register.go b/builder/vmware/iso/step_register.go index 509b6e017..a11ef17b5 100644 --- a/builder/vmware/iso/step_register.go +++ b/builder/vmware/iso/step_register.go @@ -5,8 +5,8 @@ import ( "time" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepRegister struct { diff --git a/builder/vmware/iso/step_register_test.go b/builder/vmware/iso/step_register_test.go index 8bfed06e8..6199696f0 100644 --- a/builder/vmware/iso/step_register_test.go +++ b/builder/vmware/iso/step_register_test.go @@ -1,6 +1,7 @@ package iso import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/builder/vmware/iso/step_remote_upload.go b/builder/vmware/iso/step_remote_upload.go index 76b30bfdf..48deabaab 100644 --- a/builder/vmware/iso/step_remote_upload.go +++ b/builder/vmware/iso/step_remote_upload.go @@ -5,8 +5,9 @@ import ( "log" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "log" ) // stepRemoteUpload uploads some thing from the state bag to a remote driver diff --git a/builder/vmware/iso/step_test.go b/builder/vmware/iso/step_test.go index 6ac2ba05e..66fc38d36 100644 --- a/builder/vmware/iso/step_test.go +++ b/builder/vmware/iso/step_test.go @@ -5,8 +5,9 @@ import ( "testing" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/iso/step_upload_vmx.go b/builder/vmware/iso/step_upload_vmx.go index 0c9e17c28..2fc65daaf 100644 --- a/builder/vmware/iso/step_upload_vmx.go +++ b/builder/vmware/iso/step_upload_vmx.go @@ -5,8 +5,9 @@ import ( "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" + "path/filepath" ) // This step upload the VMX to the remote host diff --git a/builder/vmware/vmx/builder.go b/builder/vmware/vmx/builder.go index b7c70d548..97852b534 100644 --- a/builder/vmware/vmx/builder.go +++ b/builder/vmware/vmx/builder.go @@ -9,8 +9,8 @@ import ( vmwcommon "github.com/hashicorp/packer/builder/vmware/common" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // Builder implements packer.Builder and builds the actual VMware diff --git a/builder/vmware/vmx/step_clone_vmx.go b/builder/vmware/vmx/step_clone_vmx.go index eaa6607c5..76318b2ef 100644 --- a/builder/vmware/vmx/step_clone_vmx.go +++ b/builder/vmware/vmx/step_clone_vmx.go @@ -6,8 +6,8 @@ import ( "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCloneVMX takes a VMX file and clones the VM into the output directory. diff --git a/builder/vmware/vmx/step_clone_vmx_test.go b/builder/vmware/vmx/step_clone_vmx_test.go index 3b4cea1d5..0fedd84c8 100644 --- a/builder/vmware/vmx/step_clone_vmx_test.go +++ b/builder/vmware/vmx/step_clone_vmx_test.go @@ -7,7 +7,7 @@ import ( "testing" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCloneVMX_impl(t *testing.T) { diff --git a/builder/vmware/vmx/step_test.go b/builder/vmware/vmx/step_test.go index 60e2f890c..81439b3c4 100644 --- a/builder/vmware/vmx/step_test.go +++ b/builder/vmware/vmx/step_test.go @@ -5,8 +5,8 @@ import ( "testing" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func testState(t *testing.T) multistep.StateBag { diff --git a/common/multistep_debug.go b/common/multistep_debug.go index 15ebb7eb0..1a5fc9f10 100644 --- a/common/multistep_debug.go +++ b/common/multistep_debug.go @@ -2,6 +2,8 @@ package common import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "time" diff --git a/common/multistep_runner.go b/common/multistep_runner.go index 6f7c0a7cb..c10c0879e 100644 --- a/common/multistep_runner.go +++ b/common/multistep_runner.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func newRunner(steps []multistep.Step, config PackerConfig, ui packer.Ui) (multistep.Runner, multistep.DebugPauseFn) { diff --git a/common/step_create_floppy.go b/common/step_create_floppy.go index d37302d5c..fdcc29f64 100644 --- a/common/step_create_floppy.go +++ b/common/step_create_floppy.go @@ -10,10 +10,10 @@ import ( "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/mitchellh/go-fs" "github.com/mitchellh/go-fs/fat" - "github.com/mitchellh/multistep" ) // StepCreateFloppy will create a floppy disk with the given files. diff --git a/common/step_create_floppy_test.go b/common/step_create_floppy_test.go index 7b5145eaa..a84c64677 100644 --- a/common/step_create_floppy_test.go +++ b/common/step_create_floppy_test.go @@ -3,6 +3,8 @@ package common import ( "bytes" "fmt" + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "io/ioutil" "log" "os" diff --git a/common/step_download.go b/common/step_download.go index 765a07d23..d0250ec34 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -7,8 +7,8 @@ import ( "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepDownload downloads a remote file using the download client within diff --git a/common/step_download_test.go b/common/step_download_test.go index de166ae55..86d632867 100644 --- a/common/step_download_test.go +++ b/common/step_download_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/common/step_http_server.go b/common/step_http_server.go index 3752b51c6..b7fd3dcfd 100644 --- a/common/step_http_server.go +++ b/common/step_http_server.go @@ -10,8 +10,8 @@ import ( "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step creates and runs the HTTP server that is serving files from the diff --git a/common/step_provision.go b/common/step_provision.go index 15a6fb921..a859fea7d 100644 --- a/common/step_provision.go +++ b/common/step_provision.go @@ -1,6 +1,8 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" + "github.com/hashicorp/packer/packer" "log" "time" diff --git a/common/step_provision_test.go b/common/step_provision_test.go index 5347aaee3..f7c40b51d 100644 --- a/common/step_provision_test.go +++ b/common/step_provision_test.go @@ -1,6 +1,7 @@ package common import ( + "github.com/hashicorp/packer/helper/multistep" "testing" "github.com/mitchellh/multistep" diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index 7d738e4cc..5f27b0765 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -5,8 +5,8 @@ import ( "log" "github.com/hashicorp/packer/communicator/none" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" gossh "golang.org/x/crypto/ssh" ) diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 9179f57e8..842e5e611 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -11,8 +11,8 @@ import ( commonssh "github.com/hashicorp/packer/common/ssh" "github.com/hashicorp/packer/communicator/ssh" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" gossh "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/net/proxy" diff --git a/helper/communicator/step_connect_test.go b/helper/communicator/step_connect_test.go index d83625dd2..aa51e1782 100644 --- a/helper/communicator/step_connect_test.go +++ b/helper/communicator/step_connect_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepConnect_impl(t *testing.T) { diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index 14f5cfc91..b1182f7d6 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -10,9 +10,9 @@ import ( "time" "github.com/hashicorp/packer/communicator/winrm" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" winrmcmd "github.com/masterzen/winrm" - "github.com/mitchellh/multistep" ) // StepConnectWinRM is a multistep Step implementation that waits for WinRM diff --git a/post-processor/googlecompute-export/post-processor.go b/post-processor/googlecompute-export/post-processor.go index 8a5befbc8..e96bbb5f8 100644 --- a/post-processor/googlecompute-export/post-processor.go +++ b/post-processor/googlecompute-export/post-processor.go @@ -8,9 +8,9 @@ import ( "github.com/hashicorp/packer/builder/googlecompute" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) type Config struct { diff --git a/post-processor/vagrant-cloud/post-processor.go b/post-processor/vagrant-cloud/post-processor.go index b8eeb7105..f6c7f19d6 100644 --- a/post-processor/vagrant-cloud/post-processor.go +++ b/post-processor/vagrant-cloud/post-processor.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" ) const VAGRANT_CLOUD_URL = "https://vagrantcloud.com/api/v1" diff --git a/post-processor/vagrant-cloud/step_create_provider.go b/post-processor/vagrant-cloud/step_create_provider.go index 4cd443577..3e43bf451 100644 --- a/post-processor/vagrant-cloud/step_create_provider.go +++ b/post-processor/vagrant-cloud/step_create_provider.go @@ -2,9 +2,8 @@ package vagrantcloud import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type Provider struct { diff --git a/post-processor/vagrant-cloud/step_create_version.go b/post-processor/vagrant-cloud/step_create_version.go index aba6da020..6a7ef9fa7 100644 --- a/post-processor/vagrant-cloud/step_create_version.go +++ b/post-processor/vagrant-cloud/step_create_version.go @@ -2,9 +2,8 @@ package vagrantcloud import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type Version struct { diff --git a/post-processor/vagrant-cloud/step_prepare_upload.go b/post-processor/vagrant-cloud/step_prepare_upload.go index 0723520b9..88fa1eb05 100644 --- a/post-processor/vagrant-cloud/step_prepare_upload.go +++ b/post-processor/vagrant-cloud/step_prepare_upload.go @@ -3,8 +3,8 @@ package vagrantcloud import ( "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type Upload struct { diff --git a/post-processor/vagrant-cloud/step_release_version.go b/post-processor/vagrant-cloud/step_release_version.go index cc4db611f..328819570 100644 --- a/post-processor/vagrant-cloud/step_release_version.go +++ b/post-processor/vagrant-cloud/step_release_version.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepReleaseVersion struct { diff --git a/post-processor/vagrant-cloud/step_upload.go b/post-processor/vagrant-cloud/step_upload.go index 7004177fd..78d3bac0a 100644 --- a/post-processor/vagrant-cloud/step_upload.go +++ b/post-processor/vagrant-cloud/step_upload.go @@ -5,8 +5,8 @@ import ( "log" "github.com/hashicorp/packer/common" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepUpload struct { diff --git a/post-processor/vagrant-cloud/step_verify_box.go b/post-processor/vagrant-cloud/step_verify_box.go index ab6ac4fe6..84f12b6fe 100644 --- a/post-processor/vagrant-cloud/step_verify_box.go +++ b/post-processor/vagrant-cloud/step_verify_box.go @@ -2,9 +2,8 @@ package vagrantcloud import ( "fmt" - + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type Box struct { diff --git a/post-processor/vsphere-template/post-processor.go b/post-processor/vsphere-template/post-processor.go index f5fba9c4e..49be4ed7c 100644 --- a/post-processor/vsphere-template/post-processor.go +++ b/post-processor/vsphere-template/post-processor.go @@ -11,9 +11,9 @@ import ( "github.com/hashicorp/packer/builder/vmware/iso" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/config" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "github.com/mitchellh/multistep" "github.com/vmware/govmomi" ) diff --git a/post-processor/vsphere-template/step_choose_datacenter.go b/post-processor/vsphere-template/step_choose_datacenter.go index 51959b6d7..f66d99d9f 100644 --- a/post-processor/vsphere-template/step_choose_datacenter.go +++ b/post-processor/vsphere-template/step_choose_datacenter.go @@ -3,8 +3,8 @@ package vsphere_template import ( "context" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/vmware/govmomi" "github.com/vmware/govmomi/find" ) diff --git a/post-processor/vsphere-template/step_create_folder.go b/post-processor/vsphere-template/step_create_folder.go index a0e648275..cf5b8a847 100644 --- a/post-processor/vsphere-template/step_create_folder.go +++ b/post-processor/vsphere-template/step_create_folder.go @@ -5,8 +5,8 @@ import ( "fmt" "path" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" ) diff --git a/post-processor/vsphere-template/step_mark_as_template.go b/post-processor/vsphere-template/step_mark_as_template.go index dffc871ca..a8a116028 100644 --- a/post-processor/vsphere-template/step_mark_as_template.go +++ b/post-processor/vsphere-template/step_mark_as_template.go @@ -7,8 +7,8 @@ import ( "regexp" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" From 07a5af66f86045cc65abbdcd445cd6ee5eecd173 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 16:20:16 -0800 Subject: [PATCH 05/19] remove ctx arg from step.run --- helper/multistep/basic_runner.go | 2 +- helper/multistep/debug_runner.go | 3 +-- helper/multistep/multistep.go | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index eb5018d36..0c928321e 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -70,7 +70,7 @@ func (b *BasicRunner) Run(state StateBag) { break } - action := step.Run(ctx, state) + action := step.Run(state) defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 88af01c54..882009494 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,7 +1,6 @@ package multistep import ( - "context" "fmt" "reflect" "sync" @@ -114,7 +113,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { +func (s *debugStepPause) Run(state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 7b4e0801f..4e3478dac 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -2,8 +2,6 @@ // discrete steps. package multistep -import "context" - // A StepAction determines the next step to take regarding multi-step actions. type StepAction uint @@ -28,7 +26,7 @@ type Step interface { // // The return value determines whether multi-step sequences continue // or should halt. - Run(context.Context, StateBag) StepAction + Run(StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this From 030b5fd4f07f73d1d8420de9021f2aae3a0ddf83 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 19:44:01 -0800 Subject: [PATCH 06/19] WIP add context to state bag --- helper/multistep/statebag.go | 44 +++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/helper/multistep/statebag.go b/helper/multistep/statebag.go index dab712316..c2f1e8a84 100644 --- a/helper/multistep/statebag.go +++ b/helper/multistep/statebag.go @@ -1,15 +1,20 @@ package multistep import ( + "context" "sync" ) +// Add context to state bag to prevent changing step signature + // StateBag holds the state that is used by the Runner and Steps. The // StateBag implementation must be safe for concurrent access. type StateBag interface { Get(string) interface{} GetOk(string) (interface{}, bool) Put(string, interface{}) + Context() context.Context + WithContext(context.Context) StateBag } // BasicStateBag implements StateBag by using a normal map underneath @@ -17,7 +22,13 @@ type StateBag interface { type BasicStateBag struct { data map[string]interface{} l sync.RWMutex - once sync.Once + ctx context.Context +} + +func NewBasicStateBag() *BasicStateBag { + b := new(BasicStateBag) + b.data = make(map[string]interface{}) + return b } func (b *BasicStateBag) Get(k string) interface{} { @@ -37,11 +48,32 @@ func (b *BasicStateBag) Put(k string, v interface{}) { b.l.Lock() defer b.l.Unlock() - // Make sure the map is initialized one time, on write - b.once.Do(func() { - b.data = make(map[string]interface{}) - }) - // Write the data b.data[k] = v } + +func (b *BasicStateBag) Context() context.Context { + if b.ctx != nil { + return b.ctx + } + return context.Background() +} + +// WithContext returns a copy of BasicStateBag with the provided context +// We copy the state bag +func (b *BasicStateBag) WithContext(ctx context.Context) *BasicStateBag { + if ctx == nil { + panic("nil context") + } + // read lock because copying is a read operation + b.l.RLock() + defer b.l.RUnlock() + + b2 := NewBasicStateBag() + + for k, v := range b.data { + b2.data[k] = v + } + b2.ctx = ctx + return b2 +} From 62e3d1362fd26e48c8b525fdc1b78e2691fd13a8 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 19:55:27 -0800 Subject: [PATCH 07/19] pass context through step.run again --- helper/multistep/basic_runner.go | 2 +- helper/multistep/debug_runner.go | 3 ++- helper/multistep/multistep.go | 4 ++- helper/multistep/statebag.go | 46 +++++--------------------------- 4 files changed, 13 insertions(+), 42 deletions(-) diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index 0c928321e..eb5018d36 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -70,7 +70,7 @@ func (b *BasicRunner) Run(state StateBag) { break } - action := step.Run(state) + action := step.Run(ctx, state) defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 882009494..88af01c54 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,6 +1,7 @@ package multistep import ( + "context" "fmt" "reflect" "sync" @@ -113,7 +114,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(state StateBag) StepAction { +func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 4e3478dac..7b4e0801f 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -2,6 +2,8 @@ // discrete steps. package multistep +import "context" + // A StepAction determines the next step to take regarding multi-step actions. type StepAction uint @@ -26,7 +28,7 @@ type Step interface { // // The return value determines whether multi-step sequences continue // or should halt. - Run(StateBag) StepAction + Run(context.Context, StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this diff --git a/helper/multistep/statebag.go b/helper/multistep/statebag.go index c2f1e8a84..9efb6d998 100644 --- a/helper/multistep/statebag.go +++ b/helper/multistep/statebag.go @@ -1,9 +1,6 @@ package multistep -import ( - "context" - "sync" -) +import "sync" // Add context to state bag to prevent changing step signature @@ -13,8 +10,6 @@ type StateBag interface { Get(string) interface{} GetOk(string) (interface{}, bool) Put(string, interface{}) - Context() context.Context - WithContext(context.Context) StateBag } // BasicStateBag implements StateBag by using a normal map underneath @@ -22,13 +17,7 @@ type StateBag interface { type BasicStateBag struct { data map[string]interface{} l sync.RWMutex - ctx context.Context -} - -func NewBasicStateBag() *BasicStateBag { - b := new(BasicStateBag) - b.data = make(map[string]interface{}) - return b + once sync.Once } func (b *BasicStateBag) Get(k string) interface{} { @@ -48,32 +37,11 @@ func (b *BasicStateBag) Put(k string, v interface{}) { b.l.Lock() defer b.l.Unlock() + // Make sure the map is initialized one time, on write + b.once.Do(func() { + b.data = make(map[string]interface{}) + }) + // Write the data b.data[k] = v } - -func (b *BasicStateBag) Context() context.Context { - if b.ctx != nil { - return b.ctx - } - return context.Background() -} - -// WithContext returns a copy of BasicStateBag with the provided context -// We copy the state bag -func (b *BasicStateBag) WithContext(ctx context.Context) *BasicStateBag { - if ctx == nil { - panic("nil context") - } - // read lock because copying is a read operation - b.l.RLock() - defer b.l.RUnlock() - - b2 := NewBasicStateBag() - - for k, v := range b.data { - b2.data[k] = v - } - b2.ctx = ctx - return b2 -} From e98f2016027578887926762377da8ad9a9fc8288 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Fri, 19 Jan 2018 20:09:05 -0800 Subject: [PATCH 08/19] working with opt-in --- builder/amazon/common/step_run_source_instance.go | 13 ++++--------- helper/multistep/basic_runner.go | 8 +++++++- helper/multistep/debug_runner.go | 3 +-- helper/multistep/multistep.go | 6 +++++- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index 9186c868c..dcf6fea70 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -37,6 +37,10 @@ type StepRunSourceInstance struct { } func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepAction { + return s.RunWithContext(context.Background(), state) +} + +func (s *StepRunSourceInstance) RunWithContext(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) var keyName string if name, ok := state.GetOk("keyPair"); ok { @@ -179,15 +183,6 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi describeInstance := &ec2.DescribeInstancesInput{ InstanceIds: []*string{aws.String(instanceId)}, } - ctx, cancel := context.WithCancel(context.Background()) - - go func() { - for { - if _, ok := state.GetOk(multistep.StateCancelled); ok { - cancel() - } - } - }() if err := ec2conn.WaitUntilInstanceRunningWithContext(ctx, describeInstance); err != nil { err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", instanceId, err) diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index eb5018d36..f152178bc 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -70,7 +70,13 @@ func (b *BasicRunner) Run(state StateBag) { break } - action := step.Run(ctx, state) + var action StepAction + + if stepCtx, ok := step.(StepRunnableWithContext); ok { + action = stepCtx.RunWithContext(ctx, state) + } else { + action = step.Run(state) + } defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 88af01c54..882009494 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,7 +1,6 @@ package multistep import ( - "context" "fmt" "reflect" "sync" @@ -114,7 +113,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { +func (s *debugStepPause) Run(state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 7b4e0801f..9b8a40b6d 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -19,6 +19,10 @@ const StateCancelled = "cancelled" // This is the key set in the state bag when a step halted the sequence. const StateHalted = "halted" +type StepRunnableWithContext interface { + RunWithContext(context.Context, StateBag) StepAction +} + // Step is a single step that is part of a potentially large sequence // of other steps, responsible for performing some specific action. type Step interface { @@ -28,7 +32,7 @@ type Step interface { // // The return value determines whether multi-step sequences continue // or should halt. - Run(context.Context, StateBag) StepAction + Run(StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this From a0c625ea4446ddcf58a616fcd2cc537440468a86 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 15:08:10 -0800 Subject: [PATCH 09/19] Revert "working with opt-in" This reverts commit 4068ffdaf541354e75507add7ca0b193993fcd52. --- builder/amazon/common/step_run_source_instance.go | 13 +++++++++---- helper/multistep/basic_runner.go | 8 +------- helper/multistep/debug_runner.go | 3 ++- helper/multistep/multistep.go | 6 +----- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index dcf6fea70..9186c868c 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -37,10 +37,6 @@ type StepRunSourceInstance struct { } func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepAction { - return s.RunWithContext(context.Background(), state) -} - -func (s *StepRunSourceInstance) RunWithContext(ctx context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) var keyName string if name, ok := state.GetOk("keyPair"); ok { @@ -183,6 +179,15 @@ func (s *StepRunSourceInstance) RunWithContext(ctx context.Context, state multis describeInstance := &ec2.DescribeInstancesInput{ InstanceIds: []*string{aws.String(instanceId)}, } + ctx, cancel := context.WithCancel(context.Background()) + + go func() { + for { + if _, ok := state.GetOk(multistep.StateCancelled); ok { + cancel() + } + } + }() if err := ec2conn.WaitUntilInstanceRunningWithContext(ctx, describeInstance); err != nil { err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", instanceId, err) diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index f152178bc..eb5018d36 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -70,13 +70,7 @@ func (b *BasicRunner) Run(state StateBag) { break } - var action StepAction - - if stepCtx, ok := step.(StepRunnableWithContext); ok { - action = stepCtx.RunWithContext(ctx, state) - } else { - action = step.Run(state) - } + action := step.Run(ctx, state) defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 882009494..88af01c54 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,6 +1,7 @@ package multistep import ( + "context" "fmt" "reflect" "sync" @@ -113,7 +114,7 @@ type debugStepPause struct { PauseFn DebugPauseFn } -func (s *debugStepPause) Run(state StateBag) StepAction { +func (s *debugStepPause) Run(_ context.Context, state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 9b8a40b6d..7b4e0801f 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -19,10 +19,6 @@ const StateCancelled = "cancelled" // This is the key set in the state bag when a step halted the sequence. const StateHalted = "halted" -type StepRunnableWithContext interface { - RunWithContext(context.Context, StateBag) StepAction -} - // Step is a single step that is part of a potentially large sequence // of other steps, responsible for performing some specific action. type Step interface { @@ -32,7 +28,7 @@ type Step interface { // // The return value determines whether multi-step sequences continue // or should halt. - Run(StateBag) StepAction + Run(context.Context, StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this From a831d522bec0ffa5fb8002f2b1c63ad69879ccc6 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 15:31:41 -0800 Subject: [PATCH 10/19] change run signatures Run now takes a context as well as a statebag. We'll assign the context to the blank identifier to prevent namespace collisions. We'll let the step authors opt-in to using the context. `find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;` --- builder/alicloud/ecs/step_attach_keypair.go | 2 +- builder/alicloud/ecs/step_check_source_image.go | 2 +- builder/alicloud/ecs/step_config_eip.go | 2 +- builder/alicloud/ecs/step_config_key_pair.go | 2 +- builder/alicloud/ecs/step_config_public_ip.go | 2 +- builder/alicloud/ecs/step_config_security_group.go | 2 +- builder/alicloud/ecs/step_config_vpc.go | 2 +- builder/alicloud/ecs/step_config_vswitch.go | 2 +- builder/alicloud/ecs/step_create_image.go | 2 +- builder/alicloud/ecs/step_create_instance.go | 2 +- builder/alicloud/ecs/step_delete_images_snapshots.go | 2 +- builder/alicloud/ecs/step_mount_disk.go | 2 +- builder/alicloud/ecs/step_pre_validate.go | 2 +- builder/alicloud/ecs/step_region_copy_image.go | 2 +- builder/alicloud/ecs/step_run_instance.go | 2 +- builder/alicloud/ecs/step_share_image.go | 2 +- builder/alicloud/ecs/step_stop_instance.go | 2 +- builder/amazon/chroot/step_attach_volume.go | 2 +- builder/amazon/chroot/step_check_root_device.go | 2 +- builder/amazon/chroot/step_chroot_provision.go | 2 +- builder/amazon/chroot/step_copy_files.go | 2 +- builder/amazon/chroot/step_create_volume.go | 2 +- builder/amazon/chroot/step_early_cleanup.go | 2 +- builder/amazon/chroot/step_early_unflock.go | 2 +- builder/amazon/chroot/step_flock.go | 2 +- builder/amazon/chroot/step_instance_info.go | 2 +- builder/amazon/chroot/step_mount_device.go | 2 +- builder/amazon/chroot/step_mount_extra.go | 2 +- builder/amazon/chroot/step_post_mount_commands.go | 2 +- builder/amazon/chroot/step_pre_mount_commands.go | 2 +- builder/amazon/chroot/step_prepare_device.go | 2 +- builder/amazon/chroot/step_register_ami.go | 2 +- builder/amazon/chroot/step_snapshot.go | 2 +- builder/amazon/common/step_ami_region_copy.go | 2 +- builder/amazon/common/step_create_tags.go | 2 +- builder/amazon/common/step_deregister_ami.go | 2 +- builder/amazon/common/step_encrypted_ami.go | 2 +- builder/amazon/common/step_get_password.go | 2 +- builder/amazon/common/step_key_pair.go | 2 +- builder/amazon/common/step_modify_ami_attributes.go | 2 +- builder/amazon/common/step_modify_ebs_instance.go | 2 +- builder/amazon/common/step_pre_validate.go | 2 +- builder/amazon/common/step_run_source_instance.go | 2 +- builder/amazon/common/step_run_spot_instance.go | 2 +- builder/amazon/common/step_security_group.go | 2 +- builder/amazon/common/step_source_ami_info.go | 2 +- builder/amazon/common/step_stop_ebs_instance.go | 2 +- builder/amazon/ebs/step_cleanup_volumes.go | 2 +- builder/amazon/ebs/step_create_ami.go | 2 +- builder/amazon/ebssurrogate/step_register_ami.go | 2 +- builder/amazon/ebssurrogate/step_snapshot_new_root.go | 2 +- builder/amazon/ebsvolume/step_tag_ebs_volumes.go | 2 +- builder/amazon/instance/step_bundle_volume.go | 2 +- builder/amazon/instance/step_register_ami.go | 2 +- builder/amazon/instance/step_upload_bundle.go | 2 +- builder/amazon/instance/step_upload_x509_cert.go | 2 +- builder/azure/arm/step_capture_image.go | 2 +- builder/azure/arm/step_create_resource_group.go | 2 +- builder/azure/arm/step_delete_os_disk.go | 2 +- builder/azure/arm/step_delete_resource_group.go | 2 +- builder/azure/arm/step_deploy_template.go | 2 +- builder/azure/arm/step_get_certificate.go | 2 +- builder/azure/arm/step_get_ip_address.go | 2 +- builder/azure/arm/step_get_os_disk.go | 2 +- builder/azure/arm/step_power_off_compute.go | 2 +- builder/azure/arm/step_set_certificate.go | 2 +- builder/azure/arm/step_validate_template.go | 2 +- builder/azure/common/lin/step_create_cert.go | 2 +- builder/azure/common/lin/step_generalize_os.go | 2 +- builder/cloudstack/step_configure_networking.go | 2 +- builder/cloudstack/step_create_instance.go | 2 +- builder/cloudstack/step_create_security_group.go | 2 +- builder/cloudstack/step_create_template.go | 2 +- builder/cloudstack/step_keypair.go | 2 +- builder/cloudstack/step_prepare_config.go | 2 +- builder/cloudstack/step_shutdown_instance.go | 2 +- builder/digitalocean/step_create_droplet.go | 2 +- builder/digitalocean/step_create_ssh_key.go | 2 +- builder/digitalocean/step_droplet_info.go | 2 +- builder/digitalocean/step_power_off.go | 2 +- builder/digitalocean/step_shutdown.go | 2 +- builder/digitalocean/step_snapshot.go | 2 +- builder/docker/step_commit.go | 2 +- builder/docker/step_connect_docker.go | 2 +- builder/docker/step_export.go | 2 +- builder/docker/step_pull.go | 2 +- builder/docker/step_run.go | 2 +- builder/docker/step_run_test.go | 2 +- builder/docker/step_temp_dir.go | 2 +- builder/googlecompute/step_check_existing_image.go | 2 +- builder/googlecompute/step_create_image.go | 2 +- builder/googlecompute/step_create_instance.go | 2 +- builder/googlecompute/step_create_ssh_key.go | 2 +- builder/googlecompute/step_create_windows_password.go | 2 +- builder/googlecompute/step_instance_info.go | 2 +- builder/googlecompute/step_teardown_instance.go | 2 +- builder/googlecompute/step_wait_startup_script.go | 2 +- builder/hyperv/common/step_clone_vm.go | 2 +- builder/hyperv/common/step_configure_ip.go | 2 +- builder/hyperv/common/step_configure_vlan.go | 2 +- builder/hyperv/common/step_create_external_switch.go | 2 +- builder/hyperv/common/step_create_switch.go | 2 +- builder/hyperv/common/step_create_tempdir.go | 2 +- builder/hyperv/common/step_create_vm.go | 2 +- builder/hyperv/common/step_disable_vlan.go | 2 +- builder/hyperv/common/step_enable_integration_service.go | 2 +- builder/hyperv/common/step_export_vm.go | 2 +- builder/hyperv/common/step_mount_dvddrive.go | 2 +- builder/hyperv/common/step_mount_floppydrive.go | 2 +- builder/hyperv/common/step_mount_guest_additions.go | 2 +- builder/hyperv/common/step_mount_secondary_dvd_images.go | 2 +- builder/hyperv/common/step_output_dir.go | 2 +- builder/hyperv/common/step_polling_installation.go | 2 +- builder/hyperv/common/step_reboot_vm.go | 2 +- builder/hyperv/common/step_run.go | 2 +- builder/hyperv/common/step_shutdown.go | 2 +- builder/hyperv/common/step_sleep.go | 2 +- builder/hyperv/common/step_type_boot_command.go | 2 +- builder/hyperv/common/step_unmount_dvddrive.go | 2 +- builder/hyperv/common/step_unmount_floppydrive.go | 2 +- builder/hyperv/common/step_unmount_guest_additions.go | 2 +- builder/hyperv/common/step_unmount_secondary_dvd_images.go | 2 +- builder/hyperv/common/step_wait_for_install_to_complete.go | 4 ++-- builder/lxc/step_export.go | 2 +- builder/lxc/step_lxc_create.go | 2 +- builder/lxc/step_prepare_output_dir.go | 2 +- builder/lxc/step_provision.go | 2 +- builder/lxc/step_wait_init.go | 2 +- builder/lxd/step_lxd_launch.go | 2 +- builder/lxd/step_provision.go | 2 +- builder/lxd/step_publish.go | 2 +- builder/oneandone/step_create_server.go | 2 +- builder/oneandone/step_create_sshkey.go | 2 +- builder/oneandone/step_take_snapshot.go | 2 +- builder/openstack/step_add_image_members.go | 2 +- builder/openstack/step_allocate_ip.go | 2 +- builder/openstack/step_create_image.go | 2 +- builder/openstack/step_get_password.go | 2 +- builder/openstack/step_key_pair.go | 2 +- builder/openstack/step_load_extensions.go | 2 +- builder/openstack/step_load_flavor.go | 2 +- builder/openstack/step_run_source_server.go | 2 +- builder/openstack/step_stop_server.go | 2 +- builder/openstack/step_update_image_visibility.go | 2 +- builder/openstack/step_wait_for_rackconnect.go | 2 +- builder/oracle/oci/step_create_instance.go | 2 +- builder/oracle/oci/step_image.go | 2 +- builder/oracle/oci/step_instance_info.go | 2 +- builder/oracle/oci/step_ssh_key_pair.go | 2 +- builder/parallels/common/step_attach_floppy.go | 2 +- builder/parallels/common/step_attach_parallels_tools.go | 2 +- builder/parallels/common/step_compact_disk.go | 2 +- builder/parallels/common/step_output_dir.go | 2 +- builder/parallels/common/step_prepare_parallels_tools.go | 2 +- builder/parallels/common/step_prlctl.go | 2 +- builder/parallels/common/step_run.go | 2 +- builder/parallels/common/step_shutdown.go | 2 +- builder/parallels/common/step_type_boot_command.go | 2 +- builder/parallels/common/step_upload_parallels_tools.go | 2 +- builder/parallels/common/step_upload_version.go | 2 +- builder/parallels/iso/step_attach_iso.go | 2 +- builder/parallels/iso/step_create_disk.go | 2 +- builder/parallels/iso/step_create_vm.go | 2 +- builder/parallels/iso/step_set_boot_order.go | 2 +- builder/parallels/pvm/step_import.go | 2 +- builder/profitbricks/step_create_server.go | 2 +- builder/profitbricks/step_create_ssh_key.go | 2 +- builder/profitbricks/step_take_snapshot.go | 2 +- builder/qemu/step_boot_wait.go | 2 +- builder/qemu/step_configure_vnc.go | 2 +- builder/qemu/step_convert_disk.go | 2 +- builder/qemu/step_copy_disk.go | 2 +- builder/qemu/step_create_disk.go | 2 +- builder/qemu/step_forward_ssh.go | 2 +- builder/qemu/step_prepare_output_dir.go | 2 +- builder/qemu/step_resize_disk.go | 2 +- builder/qemu/step_run.go | 2 +- builder/qemu/step_set_iso.go | 2 +- builder/qemu/step_shutdown.go | 2 +- builder/qemu/step_type_boot_command.go | 2 +- builder/triton/step_create_image_from_machine.go | 2 +- builder/triton/step_create_source_machine.go | 2 +- builder/triton/step_delete_machine.go | 2 +- builder/triton/step_stop_machine.go | 2 +- builder/triton/step_wait_for_stop_to_not_fail.go | 2 +- builder/virtualbox/common/step_attach_floppy.go | 2 +- builder/virtualbox/common/step_attach_guest_additions.go | 2 +- builder/virtualbox/common/step_configure_vrdp.go | 2 +- builder/virtualbox/common/step_download_guest_additions.go | 2 +- builder/virtualbox/common/step_export.go | 2 +- builder/virtualbox/common/step_forward_ssh.go | 2 +- builder/virtualbox/common/step_output_dir.go | 2 +- builder/virtualbox/common/step_remove_devices.go | 2 +- builder/virtualbox/common/step_run.go | 2 +- builder/virtualbox/common/step_shutdown.go | 2 +- builder/virtualbox/common/step_suppress_messages.go | 2 +- builder/virtualbox/common/step_type_boot_command.go | 2 +- builder/virtualbox/common/step_upload_guest_additions.go | 2 +- builder/virtualbox/common/step_upload_version.go | 2 +- builder/virtualbox/common/step_vboxmanage.go | 2 +- builder/virtualbox/iso/step_attach_iso.go | 2 +- builder/virtualbox/iso/step_create_disk.go | 2 +- builder/virtualbox/iso/step_create_vm.go | 2 +- builder/virtualbox/ovf/step_import.go | 2 +- builder/vmware/common/step_clean_files.go | 2 +- builder/vmware/common/step_clean_vmx.go | 2 +- builder/vmware/common/step_compact_disk.go | 2 +- builder/vmware/common/step_configure_vmx.go | 2 +- builder/vmware/common/step_configure_vnc.go | 2 +- builder/vmware/common/step_output_dir.go | 2 +- builder/vmware/common/step_prepare_tools.go | 2 +- builder/vmware/common/step_run.go | 2 +- builder/vmware/common/step_run_test.go | 2 +- builder/vmware/common/step_shutdown.go | 2 +- builder/vmware/common/step_suppress_messages.go | 2 +- builder/vmware/common/step_type_boot_command.go | 2 +- builder/vmware/common/step_upload_tools.go | 2 +- builder/vmware/iso/step_create_disk.go | 2 +- builder/vmware/iso/step_create_vmx.go | 2 +- builder/vmware/iso/step_export.go | 2 +- builder/vmware/iso/step_register.go | 2 +- builder/vmware/iso/step_remote_upload.go | 2 +- builder/vmware/iso/step_upload_vmx.go | 2 +- builder/vmware/vmx/step_clone_vmx.go | 2 +- common/step_create_floppy.go | 2 +- common/step_download.go | 2 +- common/step_http_server.go | 2 +- common/step_provision.go | 2 +- helper/communicator/step_connect.go | 2 +- helper/communicator/step_connect_ssh.go | 2 +- helper/communicator/step_connect_winrm.go | 2 +- post-processor/vagrant-cloud/step_create_provider.go | 2 +- post-processor/vagrant-cloud/step_create_version.go | 2 +- post-processor/vagrant-cloud/step_prepare_upload.go | 2 +- post-processor/vagrant-cloud/step_release_version.go | 2 +- post-processor/vagrant-cloud/step_upload.go | 2 +- post-processor/vagrant-cloud/step_verify_box.go | 2 +- post-processor/vsphere-template/step_choose_datacenter.go | 2 +- post-processor/vsphere-template/step_create_folder.go | 2 +- post-processor/vsphere-template/step_mark_as_template.go | 2 +- 240 files changed, 241 insertions(+), 241 deletions(-) diff --git a/builder/alicloud/ecs/step_attach_keypair.go b/builder/alicloud/ecs/step_attach_keypair.go index 012efd2b1..1bb901f98 100644 --- a/builder/alicloud/ecs/step_attach_keypair.go +++ b/builder/alicloud/ecs/step_attach_keypair.go @@ -15,7 +15,7 @@ import ( type stepAttachKeyPar struct { } -func (s *stepAttachKeyPar) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepAttachKeyPar) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { keyPairName := state.Get("keyPair").(string) if keyPairName == "" { return multistep.ActionContinue diff --git a/builder/alicloud/ecs/step_check_source_image.go b/builder/alicloud/ecs/step_check_source_image.go index 3f3ee87d0..b9dc58f69 100644 --- a/builder/alicloud/ecs/step_check_source_image.go +++ b/builder/alicloud/ecs/step_check_source_image.go @@ -13,7 +13,7 @@ type stepCheckAlicloudSourceImage struct { SourceECSImageId string } -func (s *stepCheckAlicloudSourceImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCheckAlicloudSourceImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index 2d626bf62..edf0b2748 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -16,7 +16,7 @@ type setpConfigAlicloudEIP struct { allocatedId string } -func (s *setpConfigAlicloudEIP) Run(state multistep.StateBag) multistep.StepAction { +func (s *setpConfigAlicloudEIP) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index 62fb41a9d..9c68ce92e 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -24,7 +24,7 @@ type StepConfigAlicloudKeyPair struct { keyName string } -func (s *StepConfigAlicloudKeyPair) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigAlicloudKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index c8859afa3..e87a20079 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -13,7 +13,7 @@ type stepConfigAlicloudPublicIP struct { RegionId string } -func (s *stepConfigAlicloudPublicIP) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudPublicIP) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index 8a20915d4..4414eefe6 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -20,7 +20,7 @@ type stepConfigAlicloudSecurityGroup struct { isCreate bool } -func (s *stepConfigAlicloudSecurityGroup) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) networkType := state.Get("networktype").(InstanceNetWork) diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index c03ed3944..618b4a3da 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -18,7 +18,7 @@ type stepConfigAlicloudVPC struct { isCreate bool } -func (s *stepConfigAlicloudVPC) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudVPC) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index 357e40624..5510acb3b 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -19,7 +19,7 @@ type stepConfigAlicloudVSwitch struct { VSwitchName string } -func (s *stepConfigAlicloudVSwitch) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepConfigAlicloudVSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) vpcId := state.Get("vpcid").(string) diff --git a/builder/alicloud/ecs/step_create_image.go b/builder/alicloud/ecs/step_create_image.go index 852376250..098323307 100644 --- a/builder/alicloud/ecs/step_create_image.go +++ b/builder/alicloud/ecs/step_create_image.go @@ -13,7 +13,7 @@ type stepCreateAlicloudImage struct { image *ecs.ImageType } -func (s *stepCreateAlicloudImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index b2019ade6..694ee0046 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -25,7 +25,7 @@ type stepCreateAlicloudInstance struct { instance *ecs.InstanceAttributesType } -func (s *stepCreateAlicloudInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index 841190934..39e56e7bd 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -16,7 +16,7 @@ type stepDeleteAlicloudImageSnapshots struct { AlicloudImageName string } -func (s *stepDeleteAlicloudImageSnapshots) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepDeleteAlicloudImageSnapshots) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go index 8ec517ece..509d06615 100644 --- a/builder/alicloud/ecs/step_mount_disk.go +++ b/builder/alicloud/ecs/step_mount_disk.go @@ -11,7 +11,7 @@ import ( type stepMountAlicloudDisk struct { } -func (s *stepMountAlicloudDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepMountAlicloudDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index fb4a663f5..bdcad2756 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -14,7 +14,7 @@ type stepPreValidate struct { ForceDelete bool } -func (s *stepPreValidate) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.ForceDelete { ui.Say("Force delete flag found, skipping prevalidating image name.") diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index c7b68f697..e50398539 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -15,7 +15,7 @@ type setpRegionCopyAlicloudImage struct { RegionId string } -func (s *setpRegionCopyAlicloudImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *setpRegionCopyAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if len(s.AlicloudImageDestinationRegions) == 0 { return multistep.ActionContinue } diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index f8e0f6b68..2bac6dc91 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -11,7 +11,7 @@ import ( type stepRunAlicloudInstance struct { } -func (s *stepRunAlicloudInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepRunAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ecs.InstanceAttributesType) diff --git a/builder/alicloud/ecs/step_share_image.go b/builder/alicloud/ecs/step_share_image.go index 7a95fdfd6..2f6fbf06f 100644 --- a/builder/alicloud/ecs/step_share_image.go +++ b/builder/alicloud/ecs/step_share_image.go @@ -15,7 +15,7 @@ type setpShareAlicloudImage struct { RegionId string } -func (s *setpShareAlicloudImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *setpShareAlicloudImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui) alicloudImages := state.Get("alicloudimages").(map[string]string) diff --git a/builder/alicloud/ecs/step_stop_instance.go b/builder/alicloud/ecs/step_stop_instance.go index 4a55c3aba..055f0d5d9 100644 --- a/builder/alicloud/ecs/step_stop_instance.go +++ b/builder/alicloud/ecs/step_stop_instance.go @@ -12,7 +12,7 @@ type stepStopAlicloudInstance struct { ForceStop bool } -func (s *stepStopAlicloudInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepStopAlicloudInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*ecs.Client) instance := state.Get("instance").(*ecs.InstanceAttributesType) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_attach_volume.go b/builder/amazon/chroot/step_attach_volume.go index 47fac4d57..f386a031b 100644 --- a/builder/amazon/chroot/step_attach_volume.go +++ b/builder/amazon/chroot/step_attach_volume.go @@ -23,7 +23,7 @@ type StepAttachVolume struct { volumeId string } -func (s *StepAttachVolume) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAttachVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) device := state.Get("device").(string) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/chroot/step_check_root_device.go b/builder/amazon/chroot/step_check_root_device.go index 241a46cc1..582a76b8d 100644 --- a/builder/amazon/chroot/step_check_root_device.go +++ b/builder/amazon/chroot/step_check_root_device.go @@ -11,7 +11,7 @@ import ( // StepCheckRootDevice makes sure the root device on the AMI is EBS-backed. type StepCheckRootDevice struct{} -func (s *StepCheckRootDevice) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCheckRootDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { image := state.Get("source_image").(*ec2.Image) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_chroot_provision.go b/builder/amazon/chroot/step_chroot_provision.go index eb651d78c..6eb4226c5 100644 --- a/builder/amazon/chroot/step_chroot_provision.go +++ b/builder/amazon/chroot/step_chroot_provision.go @@ -11,7 +11,7 @@ import ( type StepChrootProvision struct { } -func (s *StepChrootProvision) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepChrootProvision) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { hook := state.Get("hook").(packer.Hook) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go index d608141da..d1bdb32b4 100644 --- a/builder/amazon/chroot/step_copy_files.go +++ b/builder/amazon/chroot/step_copy_files.go @@ -21,7 +21,7 @@ type StepCopyFiles struct { files []string } -func (s *StepCopyFiles) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCopyFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_create_volume.go b/builder/amazon/chroot/step_create_volume.go index ce4b01e64..10f49b0df 100644 --- a/builder/amazon/chroot/step_create_volume.go +++ b/builder/amazon/chroot/step_create_volume.go @@ -21,7 +21,7 @@ type StepCreateVolume struct { RootVolumeSize int64 } -func (s *StepCreateVolume) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/chroot/step_early_cleanup.go b/builder/amazon/chroot/step_early_cleanup.go index c3aecc85c..449cb2a89 100644 --- a/builder/amazon/chroot/step_early_cleanup.go +++ b/builder/amazon/chroot/step_early_cleanup.go @@ -11,7 +11,7 @@ import ( // prepare for snapshotting and creating an AMI. type StepEarlyCleanup struct{} -func (s *StepEarlyCleanup) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepEarlyCleanup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cleanupKeys := []string{ "copy_files_cleanup", diff --git a/builder/amazon/chroot/step_early_unflock.go b/builder/amazon/chroot/step_early_unflock.go index 92eff391c..8c15713f8 100644 --- a/builder/amazon/chroot/step_early_unflock.go +++ b/builder/amazon/chroot/step_early_unflock.go @@ -10,7 +10,7 @@ import ( // StepEarlyUnflock unlocks the flock. type StepEarlyUnflock struct{} -func (s *StepEarlyUnflock) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepEarlyUnflock) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { cleanup := state.Get("flock_cleanup").(Cleanup) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_flock.go b/builder/amazon/chroot/step_flock.go index 4b6dd284e..d7ef614ff 100644 --- a/builder/amazon/chroot/step_flock.go +++ b/builder/amazon/chroot/step_flock.go @@ -20,7 +20,7 @@ type StepFlock struct { fh *os.File } -func (s *StepFlock) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepFlock) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) lockfile := "/var/lock/packer-chroot/lock" diff --git a/builder/amazon/chroot/step_instance_info.go b/builder/amazon/chroot/step_instance_info.go index 307e24aa8..8811a49ff 100644 --- a/builder/amazon/chroot/step_instance_info.go +++ b/builder/amazon/chroot/step_instance_info.go @@ -14,7 +14,7 @@ import ( // StepInstanceInfo verifies that this builder is running on an EC2 instance. type StepInstanceInfo struct{} -func (s *StepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepInstanceInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_mount_device.go b/builder/amazon/chroot/step_mount_device.go index 07757dba2..06fae4210 100644 --- a/builder/amazon/chroot/step_mount_device.go +++ b/builder/amazon/chroot/step_mount_device.go @@ -30,7 +30,7 @@ type StepMountDevice struct { mountPath string } -func (s *StepMountDevice) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) device := state.Get("device").(string) diff --git a/builder/amazon/chroot/step_mount_extra.go b/builder/amazon/chroot/step_mount_extra.go index 074f40199..7ebbb650a 100644 --- a/builder/amazon/chroot/step_mount_extra.go +++ b/builder/amazon/chroot/step_mount_extra.go @@ -21,7 +21,7 @@ type StepMountExtra struct { mounts []string } -func (s *StepMountExtra) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountExtra) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_post_mount_commands.go b/builder/amazon/chroot/step_post_mount_commands.go index 0ebd68d60..220e32a07 100644 --- a/builder/amazon/chroot/step_post_mount_commands.go +++ b/builder/amazon/chroot/step_post_mount_commands.go @@ -16,7 +16,7 @@ type StepPostMountCommands struct { Commands []string } -func (s *StepPostMountCommands) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPostMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) device := state.Get("device").(string) mountPath := state.Get("mount_path").(string) diff --git a/builder/amazon/chroot/step_pre_mount_commands.go b/builder/amazon/chroot/step_pre_mount_commands.go index 9a9bf69ac..b3a8aae6b 100644 --- a/builder/amazon/chroot/step_pre_mount_commands.go +++ b/builder/amazon/chroot/step_pre_mount_commands.go @@ -14,7 +14,7 @@ type StepPreMountCommands struct { Commands []string } -func (s *StepPreMountCommands) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPreMountCommands) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) device := state.Get("device").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_prepare_device.go b/builder/amazon/chroot/step_prepare_device.go index 18036f0a2..4724457e5 100644 --- a/builder/amazon/chroot/step_prepare_device.go +++ b/builder/amazon/chroot/step_prepare_device.go @@ -13,7 +13,7 @@ import ( type StepPrepareDevice struct { } -func (s *StepPrepareDevice) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPrepareDevice) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/chroot/step_register_ami.go b/builder/amazon/chroot/step_register_ami.go index c37892723..d73ea8b21 100644 --- a/builder/amazon/chroot/step_register_ami.go +++ b/builder/amazon/chroot/step_register_ami.go @@ -17,7 +17,7 @@ type StepRegisterAMI struct { EnableAMISriovNetSupport bool } -func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRegisterAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ec2conn := state.Get("ec2").(*ec2.EC2) snapshotId := state.Get("snapshot_id").(string) diff --git a/builder/amazon/chroot/step_snapshot.go b/builder/amazon/chroot/step_snapshot.go index 78c7a9a21..68a7bce2c 100644 --- a/builder/amazon/chroot/step_snapshot.go +++ b/builder/amazon/chroot/step_snapshot.go @@ -19,7 +19,7 @@ type StepSnapshot struct { snapshotId string } -func (s *StepSnapshot) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) volumeId := state.Get("volume_id").(string) diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index 3d9e4f1b6..9125453ea 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -19,7 +19,7 @@ type StepAMIRegionCopy struct { Name string } -func (s *StepAMIRegionCopy) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAMIRegionCopy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) amis := state.Get("amis").(map[string]string) diff --git a/builder/amazon/common/step_create_tags.go b/builder/amazon/common/step_create_tags.go index b0170f850..903aea91a 100644 --- a/builder/amazon/common/step_create_tags.go +++ b/builder/amazon/common/step_create_tags.go @@ -19,7 +19,7 @@ type StepCreateTags struct { Ctx interpolate.Context } -func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateTags) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_deregister_ami.go b/builder/amazon/common/step_deregister_ami.go index c8c18aca5..549987b6b 100644 --- a/builder/amazon/common/step_deregister_ami.go +++ b/builder/amazon/common/step_deregister_ami.go @@ -17,7 +17,7 @@ type StepDeregisterAMI struct { Regions []string } -func (s *StepDeregisterAMI) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeregisterAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { // Check for force deregister if !s.ForceDeregister { return multistep.ActionContinue diff --git a/builder/amazon/common/step_encrypted_ami.go b/builder/amazon/common/step_encrypted_ami.go index f47f1a19c..66174bea0 100644 --- a/builder/amazon/common/step_encrypted_ami.go +++ b/builder/amazon/common/step_encrypted_ami.go @@ -18,7 +18,7 @@ type StepCreateEncryptedAMICopy struct { AMIMappings []BlockDevice } -func (s *StepCreateEncryptedAMICopy) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateEncryptedAMICopy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) kmsKeyId := s.KeyID diff --git a/builder/amazon/common/step_get_password.go b/builder/amazon/common/step_get_password.go index 50a720ef7..28847003d 100644 --- a/builder/amazon/common/step_get_password.go +++ b/builder/amazon/common/step_get_password.go @@ -24,7 +24,7 @@ type StepGetPassword struct { Timeout time.Duration } -func (s *StepGetPassword) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) // Skip if we're not using winrm diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index cc01949c6..3558b1df2 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -22,7 +22,7 @@ type StepKeyPair struct { doCleanup bool } -func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/amazon/common/step_modify_ami_attributes.go b/builder/amazon/common/step_modify_ami_attributes.go index dc024d8bb..7ba1deb6f 100644 --- a/builder/amazon/common/step_modify_ami_attributes.go +++ b/builder/amazon/common/step_modify_ami_attributes.go @@ -21,7 +21,7 @@ type StepModifyAMIAttributes struct { Ctx interpolate.Context } -func (s *StepModifyAMIAttributes) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepModifyAMIAttributes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) session := state.Get("awsSession").(*session.Session) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_modify_ebs_instance.go b/builder/amazon/common/step_modify_ebs_instance.go index 0f9da523f..4145bc669 100644 --- a/builder/amazon/common/step_modify_ebs_instance.go +++ b/builder/amazon/common/step_modify_ebs_instance.go @@ -14,7 +14,7 @@ type StepModifyEBSBackedInstance struct { EnableAMISriovNetSupport bool } -func (s *StepModifyEBSBackedInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepModifyEBSBackedInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_pre_validate.go b/builder/amazon/common/step_pre_validate.go index 1e4a2b2a5..57fca3fad 100644 --- a/builder/amazon/common/step_pre_validate.go +++ b/builder/amazon/common/step_pre_validate.go @@ -17,7 +17,7 @@ type StepPreValidate struct { ForceDeregister bool } -func (s *StepPreValidate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.ForceDeregister { ui.Say("Force Deregister flag found, skipping prevalidating AMI Name") diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index 9186c868c..a5acf0e25 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -36,7 +36,7 @@ type StepRunSourceInstance struct { instanceId string } -func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRunSourceInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) var keyName string if name, ok := state.GetOk("keyPair"); ok { diff --git a/builder/amazon/common/step_run_spot_instance.go b/builder/amazon/common/step_run_spot_instance.go index 9968ed962..6029ac617 100644 --- a/builder/amazon/common/step_run_spot_instance.go +++ b/builder/amazon/common/step_run_spot_instance.go @@ -42,7 +42,7 @@ type StepRunSpotInstance struct { spotRequest *ec2.SpotInstanceRequest } -func (s *StepRunSpotInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRunSpotInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) var keyName string if name, ok := state.GetOk("keyPair"); ok { diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index a03f496e6..3d3ff8f35 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -23,7 +23,7 @@ type StepSecurityGroup struct { createdGroupId string } -func (s *StepSecurityGroup) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_source_ami_info.go b/builder/amazon/common/step_source_ami_info.go index 16e49c546..bc3b9dd17 100644 --- a/builder/amazon/common/step_source_ami_info.go +++ b/builder/amazon/common/step_source_ami_info.go @@ -52,7 +52,7 @@ func mostRecentAmi(images []*ec2.Image) *ec2.Image { return sortedImages[len(sortedImages)-1] } -func (s *StepSourceAMIInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSourceAMIInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/common/step_stop_ebs_instance.go b/builder/amazon/common/step_stop_ebs_instance.go index 6f5be17ce..efef99b8a 100644 --- a/builder/amazon/common/step_stop_ebs_instance.go +++ b/builder/amazon/common/step_stop_ebs_instance.go @@ -15,7 +15,7 @@ type StepStopEBSBackedInstance struct { DisableStopInstance bool } -func (s *StepStopEBSBackedInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepStopEBSBackedInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) ui := state.Get("ui").(packer.Ui) diff --git a/builder/amazon/ebs/step_cleanup_volumes.go b/builder/amazon/ebs/step_cleanup_volumes.go index 2b4484f3b..158f970e0 100644 --- a/builder/amazon/ebs/step_cleanup_volumes.go +++ b/builder/amazon/ebs/step_cleanup_volumes.go @@ -17,7 +17,7 @@ type stepCleanupVolumes struct { BlockDevices common.BlockDevices } -func (s *stepCleanupVolumes) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCleanupVolumes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { // stepCleanupVolumes is for Cleanup only return multistep.ActionContinue } diff --git a/builder/amazon/ebs/step_create_ami.go b/builder/amazon/ebs/step_create_ami.go index 2729cc64f..1ee7319bd 100644 --- a/builder/amazon/ebs/step_create_ami.go +++ b/builder/amazon/ebs/step_create_ami.go @@ -13,7 +13,7 @@ type stepCreateAMI struct { image *ec2.Image } -func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/ebssurrogate/step_register_ami.go b/builder/amazon/ebssurrogate/step_register_ami.go index d5c7924db..28c01f52d 100644 --- a/builder/amazon/ebssurrogate/step_register_ami.go +++ b/builder/amazon/ebssurrogate/step_register_ami.go @@ -19,7 +19,7 @@ type StepRegisterAMI struct { image *ec2.Image } -func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRegisterAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ec2conn := state.Get("ec2").(*ec2.EC2) snapshotId := state.Get("snapshot_id").(string) diff --git a/builder/amazon/ebssurrogate/step_snapshot_new_root.go b/builder/amazon/ebssurrogate/step_snapshot_new_root.go index 3b46ca601..111f20268 100644 --- a/builder/amazon/ebssurrogate/step_snapshot_new_root.go +++ b/builder/amazon/ebssurrogate/step_snapshot_new_root.go @@ -20,7 +20,7 @@ type StepSnapshotNewRootVolume struct { snapshotId string } -func (s *StepSnapshotNewRootVolume) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSnapshotNewRootVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) ui := state.Get("ui").(packer.Ui) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go index d99636b57..42076dec2 100644 --- a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go +++ b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go @@ -15,7 +15,7 @@ type stepTagEBSVolumes struct { Ctx interpolate.Context } -func (s *stepTagEBSVolumes) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepTagEBSVolumes) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ec2conn := state.Get("ec2").(*ec2.EC2) instance := state.Get("instance").(*ec2.Instance) sourceAMI := state.Get("source_image").(*ec2.Image) diff --git a/builder/amazon/instance/step_bundle_volume.go b/builder/amazon/instance/step_bundle_volume.go index dbce14109..61c2f5aad 100644 --- a/builder/amazon/instance/step_bundle_volume.go +++ b/builder/amazon/instance/step_bundle_volume.go @@ -23,7 +23,7 @@ type StepBundleVolume struct { Debug bool } -func (s *StepBundleVolume) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepBundleVolume) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) instance := state.Get("instance").(*ec2.Instance) diff --git a/builder/amazon/instance/step_register_ami.go b/builder/amazon/instance/step_register_ami.go index 348e7b86f..9fb41d441 100644 --- a/builder/amazon/instance/step_register_ami.go +++ b/builder/amazon/instance/step_register_ami.go @@ -15,7 +15,7 @@ type StepRegisterAMI struct { EnableAMISriovNetSupport bool } -func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRegisterAMI) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ec2conn := state.Get("ec2").(*ec2.EC2) manifestPath := state.Get("remote_manifest_path").(string) diff --git a/builder/amazon/instance/step_upload_bundle.go b/builder/amazon/instance/step_upload_bundle.go index 3a314527e..80ba9e88b 100644 --- a/builder/amazon/instance/step_upload_bundle.go +++ b/builder/amazon/instance/step_upload_bundle.go @@ -22,7 +22,7 @@ type StepUploadBundle struct { Debug bool } -func (s *StepUploadBundle) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadBundle) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) manifestName := state.Get("manifest_name").(string) diff --git a/builder/amazon/instance/step_upload_x509_cert.go b/builder/amazon/instance/step_upload_x509_cert.go index 44cd58099..3853a53c1 100644 --- a/builder/amazon/instance/step_upload_x509_cert.go +++ b/builder/amazon/instance/step_upload_x509_cert.go @@ -9,7 +9,7 @@ import ( type StepUploadX509Cert struct{} -func (s *StepUploadX509Cert) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadX509Cert) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/azure/arm/step_capture_image.go b/builder/azure/arm/step_capture_image.go index 944f75f3b..2da5bedc4 100644 --- a/builder/azure/arm/step_capture_image.go +++ b/builder/azure/arm/step_capture_image.go @@ -67,7 +67,7 @@ func (s *StepCaptureImage) captureImage(resourceGroupName string, computeName st return <-errChan } -func (s *StepCaptureImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCaptureImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Capturing image ...") var computeName = state.Get(constants.ArmComputeName).(string) diff --git a/builder/azure/arm/step_create_resource_group.go b/builder/azure/arm/step_create_resource_group.go index b9b7662df..787aad132 100644 --- a/builder/azure/arm/step_create_resource_group.go +++ b/builder/azure/arm/step_create_resource_group.go @@ -51,7 +51,7 @@ func (s *StepCreateResourceGroup) doesResourceGroupExist(resourceGroupName strin return exists.Response.StatusCode != 404, err } -func (s *StepCreateResourceGroup) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateResourceGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { var doubleResource, ok = state.GetOk(constants.ArmDoubleResourceGroupNameSet) if ok && doubleResource.(bool) { err := errors.New("You have filled in both temp_resource_group_name and build_resource_group_name. Please choose one.") diff --git a/builder/azure/arm/step_delete_os_disk.go b/builder/azure/arm/step_delete_os_disk.go index 59c644901..92e9f9757 100644 --- a/builder/azure/arm/step_delete_os_disk.go +++ b/builder/azure/arm/step_delete_os_disk.go @@ -50,7 +50,7 @@ func (s *StepDeleteOSDisk) deleteManagedDisk(resourceGroupName string, imageName return err } -func (s *StepDeleteOSDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteOSDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Deleting the temporary OS disk ...") var osDisk = state.Get(constants.ArmOSDiskVhd).(string) diff --git a/builder/azure/arm/step_delete_resource_group.go b/builder/azure/arm/step_delete_resource_group.go index 300b8f9e0..a3bc2073b 100644 --- a/builder/azure/arm/step_delete_resource_group.go +++ b/builder/azure/arm/step_delete_resource_group.go @@ -117,7 +117,7 @@ func (s *StepDeleteResourceGroup) reportIfError(err error, resourceName string) } } -func (s *StepDeleteResourceGroup) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteResourceGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Deleting resource group ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/arm/step_deploy_template.go b/builder/azure/arm/step_deploy_template.go index d6c08f7ed..06baddb24 100644 --- a/builder/azure/arm/step_deploy_template.go +++ b/builder/azure/arm/step_deploy_template.go @@ -58,7 +58,7 @@ func (s *StepDeployTemplate) deployTemplate(resourceGroupName string, deployment return err } -func (s *StepDeployTemplate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeployTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Deploying deployment template ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/arm/step_get_certificate.go b/builder/azure/arm/step_get_certificate.go index 80b623f38..df347e468 100644 --- a/builder/azure/arm/step_get_certificate.go +++ b/builder/azure/arm/step_get_certificate.go @@ -39,7 +39,7 @@ func (s *StepGetCertificate) getCertificateUrl(keyVaultName string, secretName s return *secret.ID, err } -func (s *StepGetCertificate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetCertificate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Getting the certificate's URL ...") var keyVaultName = state.Get(constants.ArmKeyVaultName).(string) diff --git a/builder/azure/arm/step_get_ip_address.go b/builder/azure/arm/step_get_ip_address.go index b6b96addf..f6ef7dc1b 100644 --- a/builder/azure/arm/step_get_ip_address.go +++ b/builder/azure/arm/step_get_ip_address.go @@ -76,7 +76,7 @@ func (s *StepGetIPAddress) getPublicIPInPrivateNetwork(resourceGroupName string, return s.getPublicIP(resourceGroupName, ipAddressName, interfaceName) } -func (s *StepGetIPAddress) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetIPAddress) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Getting the VM's IP address ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/arm/step_get_os_disk.go b/builder/azure/arm/step_get_os_disk.go index 314fc8375..706f37a54 100644 --- a/builder/azure/arm/step_get_os_disk.go +++ b/builder/azure/arm/step_get_os_disk.go @@ -37,7 +37,7 @@ func (s *StepGetOSDisk) queryCompute(resourceGroupName string, computeName strin return vm, err } -func (s *StepGetOSDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetOSDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Querying the machine's properties ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/arm/step_power_off_compute.go b/builder/azure/arm/step_power_off_compute.go index a1401faed..e44b13c97 100644 --- a/builder/azure/arm/step_power_off_compute.go +++ b/builder/azure/arm/step_power_off_compute.go @@ -37,7 +37,7 @@ func (s *StepPowerOffCompute) powerOffCompute(resourceGroupName string, computeN return err } -func (s *StepPowerOffCompute) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPowerOffCompute) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Powering off machine ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/arm/step_set_certificate.go b/builder/azure/arm/step_set_certificate.go index 34e308263..4729af0c0 100644 --- a/builder/azure/arm/step_set_certificate.go +++ b/builder/azure/arm/step_set_certificate.go @@ -22,7 +22,7 @@ func NewStepSetCertificate(config *Config, ui packer.Ui) *StepSetCertificate { return step } -func (s *StepSetCertificate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSetCertificate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Setting the certificate's URL ...") var winRMCertificateUrl = state.Get(constants.ArmCertificateUrl).(string) diff --git a/builder/azure/arm/step_validate_template.go b/builder/azure/arm/step_validate_template.go index 3c7f98a8a..bdf92e652 100644 --- a/builder/azure/arm/step_validate_template.go +++ b/builder/azure/arm/step_validate_template.go @@ -43,7 +43,7 @@ func (s *StepValidateTemplate) validateTemplate(resourceGroupName string, deploy return err } -func (s *StepValidateTemplate) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepValidateTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { s.say("Validating deployment template ...") var resourceGroupName = state.Get(constants.ArmResourceGroupName).(string) diff --git a/builder/azure/common/lin/step_create_cert.go b/builder/azure/common/lin/step_create_cert.go index 809bdd964..66dda1a3c 100644 --- a/builder/azure/common/lin/step_create_cert.go +++ b/builder/azure/common/lin/step_create_cert.go @@ -22,7 +22,7 @@ type StepCreateCert struct { TmpServiceName string } -func (s *StepCreateCert) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateCert) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating temporary certificate...") diff --git a/builder/azure/common/lin/step_generalize_os.go b/builder/azure/common/lin/step_generalize_os.go index bd55365a2..d7836d22c 100644 --- a/builder/azure/common/lin/step_generalize_os.go +++ b/builder/azure/common/lin/step_generalize_os.go @@ -12,7 +12,7 @@ type StepGeneralizeOS struct { Command string } -func (s *StepGeneralizeOS) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGeneralizeOS) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) comm := state.Get("communicator").(packer.Communicator) diff --git a/builder/cloudstack/step_configure_networking.go b/builder/cloudstack/step_configure_networking.go index ff80583e9..1e2e322b0 100644 --- a/builder/cloudstack/step_configure_networking.go +++ b/builder/cloudstack/step_configure_networking.go @@ -16,7 +16,7 @@ type stepSetupNetworking struct { publicPort int } -func (s *stepSetupNetworking) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_instance.go b/builder/cloudstack/step_create_instance.go index 578adb898..1ca0a4f70 100644 --- a/builder/cloudstack/step_create_instance.go +++ b/builder/cloudstack/step_create_instance.go @@ -27,7 +27,7 @@ type stepCreateInstance struct { } // Run executes the Packer build step that creates a CloudStack instance. -func (s *stepCreateInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_security_group.go b/builder/cloudstack/step_create_security_group.go index 372df29f7..fb5f24a4a 100644 --- a/builder/cloudstack/step_create_security_group.go +++ b/builder/cloudstack/step_create_security_group.go @@ -13,7 +13,7 @@ type stepCreateSecurityGroup struct { tempSG string } -func (s *stepCreateSecurityGroup) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSecurityGroup) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_create_template.go b/builder/cloudstack/step_create_template.go index 54345fb25..928e231d1 100644 --- a/builder/cloudstack/step_create_template.go +++ b/builder/cloudstack/step_create_template.go @@ -11,7 +11,7 @@ import ( type stepCreateTemplate struct{} -func (s *stepCreateTemplate) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_keypair.go b/builder/cloudstack/step_keypair.go index 8ecd2d1b5..7334da372 100644 --- a/builder/cloudstack/step_keypair.go +++ b/builder/cloudstack/step_keypair.go @@ -20,7 +20,7 @@ type stepKeypair struct { TemporaryKeyPairName string } -func (s *stepKeypair) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepKeypair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/cloudstack/step_prepare_config.go b/builder/cloudstack/step_prepare_config.go index 12c1c44fe..3c2944c7d 100644 --- a/builder/cloudstack/step_prepare_config.go +++ b/builder/cloudstack/step_prepare_config.go @@ -12,7 +12,7 @@ import ( type stepPrepareConfig struct{} -func (s *stepPrepareConfig) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepPrepareConfig) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/cloudstack/step_shutdown_instance.go b/builder/cloudstack/step_shutdown_instance.go index fce1fa8bc..10a4acbdd 100644 --- a/builder/cloudstack/step_shutdown_instance.go +++ b/builder/cloudstack/step_shutdown_instance.go @@ -10,7 +10,7 @@ import ( type stepShutdownInstance struct{} -func (s *stepShutdownInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepShutdownInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*cloudstack.CloudStackClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index d64224a0a..d9c8976bf 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -15,7 +15,7 @@ type stepCreateDroplet struct { dropletId int } -func (s *stepCreateDroplet) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config) diff --git a/builder/digitalocean/step_create_ssh_key.go b/builder/digitalocean/step_create_ssh_key.go index cd8f68cc0..c03809ba2 100644 --- a/builder/digitalocean/step_create_ssh_key.go +++ b/builder/digitalocean/step_create_ssh_key.go @@ -25,7 +25,7 @@ type stepCreateSSHKey struct { keyId int } -func (s *stepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_droplet_info.go b/builder/digitalocean/step_droplet_info.go index 8cb0f6112..5c4439749 100644 --- a/builder/digitalocean/step_droplet_info.go +++ b/builder/digitalocean/step_droplet_info.go @@ -11,7 +11,7 @@ import ( type stepDropletInfo struct{} -func (s *stepDropletInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepDropletInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config) diff --git a/builder/digitalocean/step_power_off.go b/builder/digitalocean/step_power_off.go index a5ed96199..3b7e8bdd0 100644 --- a/builder/digitalocean/step_power_off.go +++ b/builder/digitalocean/step_power_off.go @@ -12,7 +12,7 @@ import ( type stepPowerOff struct{} -func (s *stepPowerOff) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) c := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_shutdown.go b/builder/digitalocean/step_shutdown.go index d45f03628..98d6c0c75 100644 --- a/builder/digitalocean/step_shutdown.go +++ b/builder/digitalocean/step_shutdown.go @@ -13,7 +13,7 @@ import ( type stepShutdown struct{} -func (s *stepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) c := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/digitalocean/step_snapshot.go b/builder/digitalocean/step_snapshot.go index 46eb75a0e..ec978c8bc 100644 --- a/builder/digitalocean/step_snapshot.go +++ b/builder/digitalocean/step_snapshot.go @@ -14,7 +14,7 @@ import ( type stepSnapshot struct{} -func (s *stepSnapshot) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*godo.Client) ui := state.Get("ui").(packer.Ui) c := state.Get("config").(Config) diff --git a/builder/docker/step_commit.go b/builder/docker/step_commit.go index 167f68621..d32f5f888 100644 --- a/builder/docker/step_commit.go +++ b/builder/docker/step_commit.go @@ -11,7 +11,7 @@ type StepCommit struct { imageId string } -func (s *StepCommit) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCommit) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) containerId := state.Get("container_id").(string) config := state.Get("config").(*Config) diff --git a/builder/docker/step_connect_docker.go b/builder/docker/step_connect_docker.go index ed64091e7..2e3a3270a 100644 --- a/builder/docker/step_connect_docker.go +++ b/builder/docker/step_connect_docker.go @@ -11,7 +11,7 @@ import ( type StepConnectDocker struct{} -func (s *StepConnectDocker) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConnectDocker) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) containerId := state.Get("container_id").(string) driver := state.Get("driver").(Driver) diff --git a/builder/docker/step_export.go b/builder/docker/step_export.go index 7af86de0e..b11319f81 100644 --- a/builder/docker/step_export.go +++ b/builder/docker/step_export.go @@ -12,7 +12,7 @@ import ( // StepExport exports the container to a flat tar file. type StepExport struct{} -func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) diff --git a/builder/docker/step_pull.go b/builder/docker/step_pull.go index 8704de3d1..946029943 100644 --- a/builder/docker/step_pull.go +++ b/builder/docker/step_pull.go @@ -10,7 +10,7 @@ import ( type StepPull struct{} -func (s *StepPull) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPull) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/docker/step_run.go b/builder/docker/step_run.go index 2ac471562..c5b8fc525 100644 --- a/builder/docker/step_run.go +++ b/builder/docker/step_run.go @@ -10,7 +10,7 @@ type StepRun struct { containerId string } -func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) tempDir := state.Get("temp_dir").(string) diff --git a/builder/docker/step_run_test.go b/builder/docker/step_run_test.go index e301a11c5..66bd02baf 100644 --- a/builder/docker/step_run_test.go +++ b/builder/docker/step_run_test.go @@ -18,7 +18,7 @@ func TestStepRun_impl(t *testing.T) { var _ multistep.Step = new(StepRun) } -func TestStepRun(t *testing.T) { +func TestStepRun(_ context.Context, t *testing.T) { state := testStepRunState(t) step := new(StepRun) defer step.Cleanup(state) diff --git a/builder/docker/step_temp_dir.go b/builder/docker/step_temp_dir.go index e9af747e7..d3c1502ff 100644 --- a/builder/docker/step_temp_dir.go +++ b/builder/docker/step_temp_dir.go @@ -17,7 +17,7 @@ type StepTempDir struct { tempDir string } -func (s *StepTempDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTempDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating a temporary directory for sharing data...") diff --git a/builder/googlecompute/step_check_existing_image.go b/builder/googlecompute/step_check_existing_image.go index b2da36973..92a79f3fa 100644 --- a/builder/googlecompute/step_check_existing_image.go +++ b/builder/googlecompute/step_check_existing_image.go @@ -12,7 +12,7 @@ import ( type StepCheckExistingImage int // Run executes the Packer build step that checks if the image already exists. -func (s *StepCheckExistingImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCheckExistingImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) d := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_create_image.go b/builder/googlecompute/step_create_image.go index 7948c0188..16434f6c7 100644 --- a/builder/googlecompute/step_create_image.go +++ b/builder/googlecompute/step_create_image.go @@ -17,7 +17,7 @@ type StepCreateImage int // // The image is created from the persistent disk used by the instance. The // instance must be deleted and the disk retained before doing this step. -func (s *StepCreateImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 054d169ae..1a713f123 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -72,7 +72,7 @@ func getImage(c *Config, d Driver) (*Image, error) { } // Run executes the Packer build step that creates a GCE instance. -func (s *StepCreateInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) d := state.Get("driver").(Driver) sshPublicKey := state.Get("ssh_public_key").(string) diff --git a/builder/googlecompute/step_create_ssh_key.go b/builder/googlecompute/step_create_ssh_key.go index 9c0ad5513..f121e3dae 100644 --- a/builder/googlecompute/step_create_ssh_key.go +++ b/builder/googlecompute/step_create_ssh_key.go @@ -24,7 +24,7 @@ type StepCreateSSHKey struct { // Run executes the Packer build step that generates SSH key pairs. // The key pairs are added to the multistep state as "ssh_private_key" and // "ssh_public_key". -func (s *StepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/googlecompute/step_create_windows_password.go b/builder/googlecompute/step_create_windows_password.go index 3adeac11d..b7d09e10d 100644 --- a/builder/googlecompute/step_create_windows_password.go +++ b/builder/googlecompute/step_create_windows_password.go @@ -23,7 +23,7 @@ type StepCreateWindowsPassword struct { } // Run executes the Packer build step that sets the windows password on a Windows GCE instance. -func (s *StepCreateWindowsPassword) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateWindowsPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) d := state.Get("driver").(Driver) c := state.Get("config").(*Config) diff --git a/builder/googlecompute/step_instance_info.go b/builder/googlecompute/step_instance_info.go index 8706489c9..5604b3e9b 100644 --- a/builder/googlecompute/step_instance_info.go +++ b/builder/googlecompute/step_instance_info.go @@ -16,7 +16,7 @@ type StepInstanceInfo struct { // Run executes the Packer build step that gathers GCE instance info. // This adds "instance_ip" to the multistep state. -func (s *StepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepInstanceInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_teardown_instance.go b/builder/googlecompute/step_teardown_instance.go index 317507d82..e40e2fc7b 100644 --- a/builder/googlecompute/step_teardown_instance.go +++ b/builder/googlecompute/step_teardown_instance.go @@ -16,7 +16,7 @@ type StepTeardownInstance struct { } // Run executes the Packer build step that tears down a GCE instance. -func (s *StepTeardownInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTeardownInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/googlecompute/step_wait_startup_script.go b/builder/googlecompute/step_wait_startup_script.go index 94b1b07ce..9770d7cb3 100644 --- a/builder/googlecompute/step_wait_startup_script.go +++ b/builder/googlecompute/step_wait_startup_script.go @@ -13,7 +13,7 @@ type StepWaitStartupScript int // Run reads the instance metadata and looks for the log entry // indicating the startup script finished. -func (s *StepWaitStartupScript) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitStartupScript) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_clone_vm.go b/builder/hyperv/common/step_clone_vm.go index 733b6df1a..cda0c5da5 100644 --- a/builder/hyperv/common/step_clone_vm.go +++ b/builder/hyperv/common/step_clone_vm.go @@ -29,7 +29,7 @@ type StepCloneVM struct { EnableVirtualizationExtensions bool } -func (s *StepCloneVM) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCloneVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Cloning virtual machine...") diff --git a/builder/hyperv/common/step_configure_ip.go b/builder/hyperv/common/step_configure_ip.go index 8670f5a41..d9ca74344 100644 --- a/builder/hyperv/common/step_configure_ip.go +++ b/builder/hyperv/common/step_configure_ip.go @@ -13,7 +13,7 @@ import ( type StepConfigureIp struct { } -func (s *StepConfigureIp) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_configure_vlan.go b/builder/hyperv/common/step_configure_vlan.go index acfe26422..ea26af22e 100644 --- a/builder/hyperv/common/step_configure_vlan.go +++ b/builder/hyperv/common/step_configure_vlan.go @@ -12,7 +12,7 @@ type StepConfigureVlan struct { SwitchVlanId string } -func (s *StepConfigureVlan) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVlan) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_external_switch.go b/builder/hyperv/common/step_create_external_switch.go index 1bbfd40b7..1e0ea6976 100644 --- a/builder/hyperv/common/step_create_external_switch.go +++ b/builder/hyperv/common/step_create_external_switch.go @@ -17,7 +17,7 @@ type StepCreateExternalSwitch struct { oldSwitchName string } -func (s *StepCreateExternalSwitch) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateExternalSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_switch.go b/builder/hyperv/common/step_create_switch.go index 7d6db4c3d..0b1df3342 100644 --- a/builder/hyperv/common/step_create_switch.go +++ b/builder/hyperv/common/step_create_switch.go @@ -31,7 +31,7 @@ type StepCreateSwitch struct { createdSwitch bool } -func (s *StepCreateSwitch) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSwitch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_create_tempdir.go b/builder/hyperv/common/step_create_tempdir.go index 425235258..a9829608c 100644 --- a/builder/hyperv/common/step_create_tempdir.go +++ b/builder/hyperv/common/step_create_tempdir.go @@ -18,7 +18,7 @@ type StepCreateTempDir struct { vhdDirPath string } -func (s *StepCreateTempDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateTempDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Creating temporary directory...") diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index 6f850a044..1e28889c7 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -30,7 +30,7 @@ type StepCreateVM struct { DifferencingDisk bool } -func (s *StepCreateVM) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Creating virtual machine...") diff --git a/builder/hyperv/common/step_disable_vlan.go b/builder/hyperv/common/step_disable_vlan.go index 6c6a034da..acd0d323d 100644 --- a/builder/hyperv/common/step_disable_vlan.go +++ b/builder/hyperv/common/step_disable_vlan.go @@ -9,7 +9,7 @@ import ( type StepDisableVlan struct { } -func (s *StepDisableVlan) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDisableVlan) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_enable_integration_service.go b/builder/hyperv/common/step_enable_integration_service.go index 98e8eedb2..ddb74c41d 100644 --- a/builder/hyperv/common/step_enable_integration_service.go +++ b/builder/hyperv/common/step_enable_integration_service.go @@ -10,7 +10,7 @@ type StepEnableIntegrationService struct { name string } -func (s *StepEnableIntegrationService) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepEnableIntegrationService) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Enabling Integration Service...") diff --git a/builder/hyperv/common/step_export_vm.go b/builder/hyperv/common/step_export_vm.go index 3c33475c1..f5ff4cf93 100644 --- a/builder/hyperv/common/step_export_vm.go +++ b/builder/hyperv/common/step_export_vm.go @@ -19,7 +19,7 @@ type StepExportVm struct { SkipCompaction bool } -func (s *StepExportVm) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepExportVm) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index 97d3ff0e0..8957fe6c2 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -16,7 +16,7 @@ type StepMountDvdDrive struct { Generation uint } -func (s *StepMountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountDvdDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_mount_floppydrive.go b/builder/hyperv/common/step_mount_floppydrive.go index 749cf5ae1..ecf9b0194 100644 --- a/builder/hyperv/common/step_mount_floppydrive.go +++ b/builder/hyperv/common/step_mount_floppydrive.go @@ -23,7 +23,7 @@ type StepMountFloppydrive struct { floppyPath string } -func (s *StepMountFloppydrive) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountFloppydrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if s.Generation > 1 { return multistep.ActionContinue } diff --git a/builder/hyperv/common/step_mount_guest_additions.go b/builder/hyperv/common/step_mount_guest_additions.go index 1cf549735..f20e070d3 100644 --- a/builder/hyperv/common/step_mount_guest_additions.go +++ b/builder/hyperv/common/step_mount_guest_additions.go @@ -13,7 +13,7 @@ type StepMountGuestAdditions struct { Generation uint } -func (s *StepMountGuestAdditions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.GuestAdditionsMode != "attach" { diff --git a/builder/hyperv/common/step_mount_secondary_dvd_images.go b/builder/hyperv/common/step_mount_secondary_dvd_images.go index c5be1a03b..9b29a84a0 100644 --- a/builder/hyperv/common/step_mount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_mount_secondary_dvd_images.go @@ -18,7 +18,7 @@ type DvdControllerProperties struct { Existing bool } -func (s *StepMountSecondaryDvdImages) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepMountSecondaryDvdImages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Mounting secondary DVD images...") diff --git a/builder/hyperv/common/step_output_dir.go b/builder/hyperv/common/step_output_dir.go index acb905e9a..cad96b98e 100644 --- a/builder/hyperv/common/step_output_dir.go +++ b/builder/hyperv/common/step_output_dir.go @@ -21,7 +21,7 @@ type StepOutputDir struct { cleanup bool } -func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if _, err := os.Stat(s.Path); err == nil { diff --git a/builder/hyperv/common/step_polling_installation.go b/builder/hyperv/common/step_polling_installation.go index 114684f59..092c01b17 100644 --- a/builder/hyperv/common/step_polling_installation.go +++ b/builder/hyperv/common/step_polling_installation.go @@ -17,7 +17,7 @@ const port string = "13000" type StepPollingInstalation struct { } -func (s *StepPollingInstalation) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPollingInstalation) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) errorMsg := "Error polling VM: %s" diff --git a/builder/hyperv/common/step_reboot_vm.go b/builder/hyperv/common/step_reboot_vm.go index 3708f97cb..850c6aac9 100644 --- a/builder/hyperv/common/step_reboot_vm.go +++ b/builder/hyperv/common/step_reboot_vm.go @@ -10,7 +10,7 @@ import ( type StepRebootVm struct { } -func (s *StepRebootVm) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRebootVm) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_run.go b/builder/hyperv/common/step_run.go index 168f29520..ead739667 100644 --- a/builder/hyperv/common/step_run.go +++ b/builder/hyperv/common/step_run.go @@ -13,7 +13,7 @@ type StepRun struct { vmName string } -func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/hyperv/common/step_shutdown.go b/builder/hyperv/common/step_shutdown.go index 42e408799..ddced9619 100644 --- a/builder/hyperv/common/step_shutdown.go +++ b/builder/hyperv/common/step_shutdown.go @@ -28,7 +28,7 @@ type StepShutdown struct { Timeout time.Duration } -func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) diff --git a/builder/hyperv/common/step_sleep.go b/builder/hyperv/common/step_sleep.go index 19b4c2c1f..fbf671cdf 100644 --- a/builder/hyperv/common/step_sleep.go +++ b/builder/hyperv/common/step_sleep.go @@ -12,7 +12,7 @@ type StepSleep struct { ActionName string } -func (s *StepSleep) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSleep) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if len(s.ActionName) > 0 { diff --git a/builder/hyperv/common/step_type_boot_command.go b/builder/hyperv/common/step_type_boot_command.go index d38c53166..515c30907 100644 --- a/builder/hyperv/common/step_type_boot_command.go +++ b/builder/hyperv/common/step_type_boot_command.go @@ -26,7 +26,7 @@ type StepTypeBootCommand struct { Ctx interpolate.Context } -func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTypeBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { httpPort := state.Get("http_port").(uint) ui := state.Get("ui").(packer.Ui) driver := state.Get("driver").(Driver) diff --git a/builder/hyperv/common/step_unmount_dvddrive.go b/builder/hyperv/common/step_unmount_dvddrive.go index 810e055ce..cb62bc131 100644 --- a/builder/hyperv/common/step_unmount_dvddrive.go +++ b/builder/hyperv/common/step_unmount_dvddrive.go @@ -9,7 +9,7 @@ import ( type StepUnmountDvdDrive struct { } -func (s *StepUnmountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountDvdDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_floppydrive.go b/builder/hyperv/common/step_unmount_floppydrive.go index be71861c2..07dff3b70 100644 --- a/builder/hyperv/common/step_unmount_floppydrive.go +++ b/builder/hyperv/common/step_unmount_floppydrive.go @@ -10,7 +10,7 @@ type StepUnmountFloppyDrive struct { Generation uint } -func (s *StepUnmountFloppyDrive) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountFloppyDrive) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_guest_additions.go b/builder/hyperv/common/step_unmount_guest_additions.go index 44b9b5acb..112c9c825 100644 --- a/builder/hyperv/common/step_unmount_guest_additions.go +++ b/builder/hyperv/common/step_unmount_guest_additions.go @@ -9,7 +9,7 @@ import ( type StepUnmountGuestAdditions struct { } -func (s *StepUnmountGuestAdditions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/hyperv/common/step_unmount_secondary_dvd_images.go b/builder/hyperv/common/step_unmount_secondary_dvd_images.go index 9e3ccbfc9..3de0f7ac6 100644 --- a/builder/hyperv/common/step_unmount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_unmount_secondary_dvd_images.go @@ -9,7 +9,7 @@ import ( type StepUnmountSecondaryDvdImages struct { } -func (s *StepUnmountSecondaryDvdImages) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUnmountSecondaryDvdImages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/hyperv/common/step_wait_for_install_to_complete.go b/builder/hyperv/common/step_wait_for_install_to_complete.go index a147d6963..ee7d11beb 100644 --- a/builder/hyperv/common/step_wait_for_install_to_complete.go +++ b/builder/hyperv/common/step_wait_for_install_to_complete.go @@ -14,7 +14,7 @@ const ( type StepWaitForPowerOff struct { } -func (s *StepWaitForPowerOff) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForPowerOff) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) @@ -48,7 +48,7 @@ type StepWaitForInstallToComplete struct { ActionName string } -func (s *StepWaitForInstallToComplete) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForInstallToComplete) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/lxc/step_export.go b/builder/lxc/step_export.go index 632891a36..2bafdeb41 100644 --- a/builder/lxc/step_export.go +++ b/builder/lxc/step_export.go @@ -18,7 +18,7 @@ import ( type stepExport struct{} -func (s *stepExport) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_lxc_create.go b/builder/lxc/step_lxc_create.go index 4d46a0f5c..9efb7bc87 100644 --- a/builder/lxc/step_lxc_create.go +++ b/builder/lxc/step_lxc_create.go @@ -16,7 +16,7 @@ import ( type stepLxcCreate struct{} -func (s *stepLxcCreate) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepLxcCreate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_prepare_output_dir.go b/builder/lxc/step_prepare_output_dir.go index ed79ac75e..1dd082580 100644 --- a/builder/lxc/step_prepare_output_dir.go +++ b/builder/lxc/step_prepare_output_dir.go @@ -13,7 +13,7 @@ import ( type stepPrepareOutputDir struct{} -func (stepPrepareOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (stepPrepareOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxc/step_provision.go b/builder/lxc/step_provision.go index c6d7f305e..937435d85 100644 --- a/builder/lxc/step_provision.go +++ b/builder/lxc/step_provision.go @@ -9,7 +9,7 @@ import ( // StepProvision provisions the instance within a chroot. type StepProvision struct{} -func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepProvision) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { hook := state.Get("hook").(packer.Hook) config := state.Get("config").(*Config) mountPath := state.Get("mount_path").(string) diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index 1c850a90b..19383fb62 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -17,7 +17,7 @@ type StepWaitInit struct { WaitTimeout time.Duration } -func (s *StepWaitInit) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitInit) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var err error diff --git a/builder/lxd/step_lxd_launch.go b/builder/lxd/step_lxd_launch.go index 491a880a9..f1a6f6b45 100644 --- a/builder/lxd/step_lxd_launch.go +++ b/builder/lxd/step_lxd_launch.go @@ -9,7 +9,7 @@ import ( type stepLxdLaunch struct{} -func (s *stepLxdLaunch) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepLxdLaunch) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxd/step_provision.go b/builder/lxd/step_provision.go index 6bd7d617c..dedd1a2ae 100644 --- a/builder/lxd/step_provision.go +++ b/builder/lxd/step_provision.go @@ -9,7 +9,7 @@ import ( // StepProvision provisions the container type StepProvision struct{} -func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepProvision) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { hook := state.Get("hook").(packer.Hook) config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/lxd/step_publish.go b/builder/lxd/step_publish.go index 280dfe1cf..4a6c206fe 100644 --- a/builder/lxd/step_publish.go +++ b/builder/lxd/step_publish.go @@ -9,7 +9,7 @@ import ( type stepPublish struct{} -func (s *stepPublish) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepPublish) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/oneandone/step_create_server.go b/builder/oneandone/step_create_server.go index 505a80242..8aa05fb48 100644 --- a/builder/oneandone/step_create_server.go +++ b/builder/oneandone/step_create_server.go @@ -14,7 +14,7 @@ import ( type stepCreateServer struct{} -func (s *stepCreateServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/oneandone/step_create_sshkey.go b/builder/oneandone/step_create_sshkey.go index e365a1362..9a1a58528 100644 --- a/builder/oneandone/step_create_sshkey.go +++ b/builder/oneandone/step_create_sshkey.go @@ -14,7 +14,7 @@ type StepCreateSSHKey struct { DebugKeyPath string } -func (s *StepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/oneandone/step_take_snapshot.go b/builder/oneandone/step_take_snapshot.go index 2e6192d13..cedfb604a 100644 --- a/builder/oneandone/step_take_snapshot.go +++ b/builder/oneandone/step_take_snapshot.go @@ -8,7 +8,7 @@ import ( type stepTakeSnapshot struct{} -func (s *stepTakeSnapshot) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepTakeSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/openstack/step_add_image_members.go b/builder/openstack/step_add_image_members.go index 3160a0e46..eda4122ce 100644 --- a/builder/openstack/step_add_image_members.go +++ b/builder/openstack/step_add_image_members.go @@ -10,7 +10,7 @@ import ( type stepAddImageMembers struct{} -func (s *stepAddImageMembers) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepAddImageMembers) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { imageId := state.Get("image").(string) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/builder/openstack/step_allocate_ip.go b/builder/openstack/step_allocate_ip.go index 2de35b8ee..15f214d17 100644 --- a/builder/openstack/step_allocate_ip.go +++ b/builder/openstack/step_allocate_ip.go @@ -16,7 +16,7 @@ type StepAllocateIp struct { ReuseIps bool } -func (s *StepAllocateIp) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAllocateIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) server := state.Get("server").(*servers.Server) diff --git a/builder/openstack/step_create_image.go b/builder/openstack/step_create_image.go index 35fbd371a..777a3cb6a 100644 --- a/builder/openstack/step_create_image.go +++ b/builder/openstack/step_create_image.go @@ -14,7 +14,7 @@ import ( type stepCreateImage struct{} -func (s *stepCreateImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) server := state.Get("server").(*servers.Server) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_get_password.go b/builder/openstack/step_get_password.go index 9a5d8c95d..95f52e194 100644 --- a/builder/openstack/step_get_password.go +++ b/builder/openstack/step_get_password.go @@ -20,7 +20,7 @@ type StepGetPassword struct { Comm *communicator.Config } -func (s *StepGetPassword) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepGetPassword) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_key_pair.go b/builder/openstack/step_key_pair.go index b6b072216..fb46c1392 100644 --- a/builder/openstack/step_key_pair.go +++ b/builder/openstack/step_key_pair.go @@ -25,7 +25,7 @@ type StepKeyPair struct { doCleanup bool } -func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/openstack/step_load_extensions.go b/builder/openstack/step_load_extensions.go index a7feec875..a5ffe8145 100644 --- a/builder/openstack/step_load_extensions.go +++ b/builder/openstack/step_load_extensions.go @@ -15,7 +15,7 @@ import ( // the flavor by name. type StepLoadExtensions struct{} -func (s *StepLoadExtensions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepLoadExtensions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_load_flavor.go b/builder/openstack/step_load_flavor.go index ddc456681..00f1b7092 100644 --- a/builder/openstack/step_load_flavor.go +++ b/builder/openstack/step_load_flavor.go @@ -16,7 +16,7 @@ type StepLoadFlavor struct { Flavor string } -func (s *StepLoadFlavor) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepLoadFlavor) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_run_source_server.go b/builder/openstack/step_run_source_server.go index 8b29357bb..ebbc45773 100644 --- a/builder/openstack/step_run_source_server.go +++ b/builder/openstack/step_run_source_server.go @@ -25,7 +25,7 @@ type StepRunSourceServer struct { server *servers.Server } -func (s *StepRunSourceServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRunSourceServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) flavor := state.Get("flavor_id").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/openstack/step_stop_server.go b/builder/openstack/step_stop_server.go index 48d1eb4d7..bc651b7ce 100644 --- a/builder/openstack/step_stop_server.go +++ b/builder/openstack/step_stop_server.go @@ -11,7 +11,7 @@ import ( type StepStopServer struct{} -func (s *StepStopServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepStopServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) extensions := state.Get("extensions").(map[string]struct{}) diff --git a/builder/openstack/step_update_image_visibility.go b/builder/openstack/step_update_image_visibility.go index d003f2894..bd814638b 100644 --- a/builder/openstack/step_update_image_visibility.go +++ b/builder/openstack/step_update_image_visibility.go @@ -10,7 +10,7 @@ import ( type stepUpdateImageVisibility struct{} -func (s *stepUpdateImageVisibility) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepUpdateImageVisibility) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { imageId := state.Get("image").(string) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/builder/openstack/step_wait_for_rackconnect.go b/builder/openstack/step_wait_for_rackconnect.go index 1b17a9d27..f214e0894 100644 --- a/builder/openstack/step_wait_for_rackconnect.go +++ b/builder/openstack/step_wait_for_rackconnect.go @@ -13,7 +13,7 @@ type StepWaitForRackConnect struct { Wait bool } -func (s *StepWaitForRackConnect) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForRackConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if !s.Wait { return multistep.ActionContinue } diff --git a/builder/oracle/oci/step_create_instance.go b/builder/oracle/oci/step_create_instance.go index ad18a7e81..cb1ce6642 100644 --- a/builder/oracle/oci/step_create_instance.go +++ b/builder/oracle/oci/step_create_instance.go @@ -9,7 +9,7 @@ import ( type stepCreateInstance struct{} -func (s *stepCreateInstance) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateInstance) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { var ( driver = state.Get("driver").(Driver) ui = state.Get("ui").(packer.Ui) diff --git a/builder/oracle/oci/step_image.go b/builder/oracle/oci/step_image.go index b7ce54057..46c7ed8ba 100644 --- a/builder/oracle/oci/step_image.go +++ b/builder/oracle/oci/step_image.go @@ -9,7 +9,7 @@ import ( type stepImage struct{} -func (s *stepImage) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepImage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { var ( driver = state.Get("driver").(Driver) ui = state.Get("ui").(packer.Ui) diff --git a/builder/oracle/oci/step_instance_info.go b/builder/oracle/oci/step_instance_info.go index df70434b0..9b79529cc 100644 --- a/builder/oracle/oci/step_instance_info.go +++ b/builder/oracle/oci/step_instance_info.go @@ -9,7 +9,7 @@ import ( type stepInstanceInfo struct{} -func (s *stepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepInstanceInfo) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { var ( driver = state.Get("driver").(Driver) ui = state.Get("ui").(packer.Ui) diff --git a/builder/oracle/oci/step_ssh_key_pair.go b/builder/oracle/oci/step_ssh_key_pair.go index b7a89ae63..c9e80e54b 100644 --- a/builder/oracle/oci/step_ssh_key_pair.go +++ b/builder/oracle/oci/step_ssh_key_pair.go @@ -21,7 +21,7 @@ type stepKeyPair struct { PrivateKeyFile string } -func (s *stepKeyPair) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if s.PrivateKeyFile != "" { diff --git a/builder/parallels/common/step_attach_floppy.go b/builder/parallels/common/step_attach_floppy.go index ec8a0663d..bd8116597 100644 --- a/builder/parallels/common/step_attach_floppy.go +++ b/builder/parallels/common/step_attach_floppy.go @@ -22,7 +22,7 @@ type StepAttachFloppy struct { // Run adds a virtual FDD device to the VM and attaches the image. // If the image is not specified, then this step will be skipped. -func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAttachFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { // Determine if we even have a floppy disk to attach var floppyPath string if floppyPathRaw, ok := state.GetOk("floppy_path"); ok { diff --git a/builder/parallels/common/step_attach_parallels_tools.go b/builder/parallels/common/step_attach_parallels_tools.go index 3d7534960..645cec0d7 100644 --- a/builder/parallels/common/step_attach_parallels_tools.go +++ b/builder/parallels/common/step_attach_parallels_tools.go @@ -25,7 +25,7 @@ type StepAttachParallelsTools struct { // Run adds a virtual CD-ROM device to the VM and attaches Parallels Tools ISO image. // If ISO image is not specified, then this step will be skipped. -func (s *StepAttachParallelsTools) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAttachParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_compact_disk.go b/builder/parallels/common/step_compact_disk.go index a79cf9f7b..90f05b7f9 100644 --- a/builder/parallels/common/step_compact_disk.go +++ b/builder/parallels/common/step_compact_disk.go @@ -22,7 +22,7 @@ type StepCompactDisk struct { } // Run runs the compaction of the virtual disk attached to the VM. -func (s *StepCompactDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCompactDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) vmName := state.Get("vmName").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_output_dir.go b/builder/parallels/common/step_output_dir.go index a3cb8db5a..c94ab3928 100644 --- a/builder/parallels/common/step_output_dir.go +++ b/builder/parallels/common/step_output_dir.go @@ -21,7 +21,7 @@ type StepOutputDir struct { } // Run sets up the output directory. -func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if _, err := os.Stat(s.Path); err == nil && s.Force { diff --git a/builder/parallels/common/step_prepare_parallels_tools.go b/builder/parallels/common/step_prepare_parallels_tools.go index 174274b3d..c64fd395b 100644 --- a/builder/parallels/common/step_prepare_parallels_tools.go +++ b/builder/parallels/common/step_prepare_parallels_tools.go @@ -21,7 +21,7 @@ type StepPrepareParallelsTools struct { } // Run sets the value of "parallels_tools_path". -func (s *StepPrepareParallelsTools) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPrepareParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if s.ParallelsToolsMode == ParallelsToolsModeDisable { diff --git a/builder/parallels/common/step_prlctl.go b/builder/parallels/common/step_prlctl.go index b93b396f0..eea179a70 100644 --- a/builder/parallels/common/step_prlctl.go +++ b/builder/parallels/common/step_prlctl.go @@ -28,7 +28,7 @@ type StepPrlctl struct { } // Run executes `prlctl` commands. -func (s *StepPrlctl) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepPrlctl) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_run.go b/builder/parallels/common/step_run.go index 38ca6269b..b37e536d5 100644 --- a/builder/parallels/common/step_run.go +++ b/builder/parallels/common/step_run.go @@ -23,7 +23,7 @@ type StepRun struct { } // Run starts the VM. -func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/common/step_shutdown.go b/builder/parallels/common/step_shutdown.go index 0eaaff454..10a4c5a3f 100644 --- a/builder/parallels/common/step_shutdown.go +++ b/builder/parallels/common/step_shutdown.go @@ -28,7 +28,7 @@ type StepShutdown struct { } // Run shuts down the VM. -func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_type_boot_command.go b/builder/parallels/common/step_type_boot_command.go index 454b726db..bd6adbfd8 100644 --- a/builder/parallels/common/step_type_boot_command.go +++ b/builder/parallels/common/step_type_boot_command.go @@ -39,7 +39,7 @@ type StepTypeBootCommand struct { } // Run types the boot command by sending key scancodes into the VM. -func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTypeBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { debug := state.Get("debug").(bool) httpPort := state.Get("http_port").(uint) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_upload_parallels_tools.go b/builder/parallels/common/step_upload_parallels_tools.go index f40a601b6..86bd5171b 100644 --- a/builder/parallels/common/step_upload_parallels_tools.go +++ b/builder/parallels/common/step_upload_parallels_tools.go @@ -37,7 +37,7 @@ type StepUploadParallelsTools struct { } // Run uploads the Parallels Tools ISO to the VM. -func (s *StepUploadParallelsTools) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadParallelsTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/common/step_upload_version.go b/builder/parallels/common/step_upload_version.go index 871f98400..982f38f9f 100644 --- a/builder/parallels/common/step_upload_version.go +++ b/builder/parallels/common/step_upload_version.go @@ -21,7 +21,7 @@ type StepUploadVersion struct { } // Run uploads a file containing the version of Parallels Desktop. -func (s *StepUploadVersion) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_attach_iso.go b/builder/parallels/iso/step_attach_iso.go index 2ce5c7387..bfb7bacf9 100644 --- a/builder/parallels/iso/step_attach_iso.go +++ b/builder/parallels/iso/step_attach_iso.go @@ -21,7 +21,7 @@ import ( // attachedIso bool type stepAttachISO struct{} -func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepAttachISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) isoPath := state.Get("iso_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index e7814507e..d98f8c5b4 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -13,7 +13,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/parallels/iso/step_create_vm.go b/builder/parallels/iso/step_create_vm.go index 0349931fa..255bafaaa 100644 --- a/builder/parallels/iso/step_create_vm.go +++ b/builder/parallels/iso/step_create_vm.go @@ -16,7 +16,7 @@ type stepCreateVM struct { vmName string } -func (s *stepCreateVM) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(parallelscommon.Driver) diff --git a/builder/parallels/iso/step_set_boot_order.go b/builder/parallels/iso/step_set_boot_order.go index 5b6837919..5b44d98af 100644 --- a/builder/parallels/iso/step_set_boot_order.go +++ b/builder/parallels/iso/step_set_boot_order.go @@ -18,7 +18,7 @@ import ( // Produces: type stepSetBootOrder struct{} -func (s *stepSetBootOrder) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepSetBootOrder) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/parallels/pvm/step_import.go b/builder/parallels/pvm/step_import.go index d2b49f136..c8b97dd54 100644 --- a/builder/parallels/pvm/step_import.go +++ b/builder/parallels/pvm/step_import.go @@ -15,7 +15,7 @@ type StepImport struct { vmName string } -func (s *StepImport) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepImport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(parallelscommon.Driver) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_create_server.go b/builder/profitbricks/step_create_server.go index 3d2145e27..926864118 100644 --- a/builder/profitbricks/step_create_server.go +++ b/builder/profitbricks/step_create_server.go @@ -15,7 +15,7 @@ import ( type stepCreateServer struct{} -func (s *stepCreateServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_create_ssh_key.go b/builder/profitbricks/step_create_ssh_key.go index 26343d8a1..4c1a75d18 100644 --- a/builder/profitbricks/step_create_ssh_key.go +++ b/builder/profitbricks/step_create_ssh_key.go @@ -14,7 +14,7 @@ type StepCreateSSHKey struct { DebugKeyPath string } -func (s *StepCreateSSHKey) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/profitbricks/step_take_snapshot.go b/builder/profitbricks/step_take_snapshot.go index 31e22a379..8cbc208b8 100644 --- a/builder/profitbricks/step_take_snapshot.go +++ b/builder/profitbricks/step_take_snapshot.go @@ -11,7 +11,7 @@ import ( type stepTakeSnapshot struct{} -func (s *stepTakeSnapshot) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepTakeSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) c := state.Get("config").(*Config) diff --git a/builder/qemu/step_boot_wait.go b/builder/qemu/step_boot_wait.go index 71d166689..fe7025b84 100644 --- a/builder/qemu/step_boot_wait.go +++ b/builder/qemu/step_boot_wait.go @@ -10,7 +10,7 @@ import ( // stepBootWait waits the configured time period. type stepBootWait struct{} -func (s *stepBootWait) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepBootWait) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_configure_vnc.go b/builder/qemu/step_configure_vnc.go index 4224e2f33..5d412b811 100644 --- a/builder/qemu/step_configure_vnc.go +++ b/builder/qemu/step_configure_vnc.go @@ -20,7 +20,7 @@ import ( // vnc_port uint - The port that VNC is configured to listen on. type stepConfigureVNC struct{} -func (stepConfigureVNC) Run(state multistep.StateBag) multistep.StepAction { +func (stepConfigureVNC) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_convert_disk.go b/builder/qemu/step_convert_disk.go index f74dc75d4..209361f5d 100644 --- a/builder/qemu/step_convert_disk.go +++ b/builder/qemu/step_convert_disk.go @@ -14,7 +14,7 @@ import ( // hard drive for the virtual machine. type stepConvertDisk struct{} -func (s *stepConvertDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepConvertDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) diskName := state.Get("disk_filename").(string) diff --git a/builder/qemu/step_copy_disk.go b/builder/qemu/step_copy_disk.go index d60c10dec..a6a2e8ca1 100644 --- a/builder/qemu/step_copy_disk.go +++ b/builder/qemu/step_copy_disk.go @@ -12,7 +12,7 @@ import ( // hard drive for the virtual machine. type stepCopyDisk struct{} -func (s *stepCopyDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCopyDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) isoPath := state.Get("iso_path").(string) diff --git a/builder/qemu/step_create_disk.go b/builder/qemu/step_create_disk.go index ab0250e9b..05b5d0833 100644 --- a/builder/qemu/step_create_disk.go +++ b/builder/qemu/step_create_disk.go @@ -12,7 +12,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_forward_ssh.go b/builder/qemu/step_forward_ssh.go index ec1e9e18b..296c94d19 100644 --- a/builder/qemu/step_forward_ssh.go +++ b/builder/qemu/step_forward_ssh.go @@ -18,7 +18,7 @@ import ( // Produces: type stepForwardSSH struct{} -func (s *stepForwardSSH) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepForwardSSH) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_prepare_output_dir.go b/builder/qemu/step_prepare_output_dir.go index 019e99bec..f24138c4c 100644 --- a/builder/qemu/step_prepare_output_dir.go +++ b/builder/qemu/step_prepare_output_dir.go @@ -13,7 +13,7 @@ import ( type stepPrepareOutputDir struct{} -func (stepPrepareOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (stepPrepareOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_resize_disk.go b/builder/qemu/step_resize_disk.go index a6bc96487..63b430187 100644 --- a/builder/qemu/step_resize_disk.go +++ b/builder/qemu/step_resize_disk.go @@ -12,7 +12,7 @@ import ( // hard drive for the virtual machine. type stepResizeDisk struct{} -func (s *stepResizeDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepResizeDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index a9b00798e..463c8bf07 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -27,7 +27,7 @@ type qemuArgsTemplateData struct { SSHHostPort uint } -func (s *stepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_set_iso.go b/builder/qemu/step_set_iso.go index ff0f03b5b..e17bbd254 100644 --- a/builder/qemu/step_set_iso.go +++ b/builder/qemu/step_set_iso.go @@ -14,7 +14,7 @@ type stepSetISO struct { Url []string } -func (s *stepSetISO) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepSetISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) iso_path := "" diff --git a/builder/qemu/step_shutdown.go b/builder/qemu/step_shutdown.go index 4efd85892..394fc16fa 100644 --- a/builder/qemu/step_shutdown.go +++ b/builder/qemu/step_shutdown.go @@ -23,7 +23,7 @@ import ( // type stepShutdown struct{} -func (s *stepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/qemu/step_type_boot_command.go b/builder/qemu/step_type_boot_command.go index fb0985d13..dbc896a48 100644 --- a/builder/qemu/step_type_boot_command.go +++ b/builder/qemu/step_type_boot_command.go @@ -40,7 +40,7 @@ type bootCommandTemplateData struct { // type stepTypeBootCommand struct{} -func (s *stepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepTypeBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) debug := state.Get("debug").(bool) httpPort := state.Get("http_port").(uint) diff --git a/builder/triton/step_create_image_from_machine.go b/builder/triton/step_create_image_from_machine.go index cbda57e0b..df83e5205 100644 --- a/builder/triton/step_create_image_from_machine.go +++ b/builder/triton/step_create_image_from_machine.go @@ -13,7 +13,7 @@ import ( // The machine must be in the "stopped" state prior to this step being run. type StepCreateImageFromMachine struct{} -func (s *StepCreateImageFromMachine) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateImageFromMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_create_source_machine.go b/builder/triton/step_create_source_machine.go index a52d35e50..bca123508 100644 --- a/builder/triton/step_create_source_machine.go +++ b/builder/triton/step_create_source_machine.go @@ -12,7 +12,7 @@ import ( // and waits for it to become available for provisioners. type StepCreateSourceMachine struct{} -func (s *StepCreateSourceMachine) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateSourceMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_delete_machine.go b/builder/triton/step_delete_machine.go index bccb791df..28d27f268 100644 --- a/builder/triton/step_delete_machine.go +++ b/builder/triton/step_delete_machine.go @@ -11,7 +11,7 @@ import ( // StepDeleteMachine deletes the machine with the ID specified in state["machine"] type StepDeleteMachine struct{} -func (s *StepDeleteMachine) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDeleteMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_stop_machine.go b/builder/triton/step_stop_machine.go index 4c2ab0d63..6c01805a5 100644 --- a/builder/triton/step_stop_machine.go +++ b/builder/triton/step_stop_machine.go @@ -12,7 +12,7 @@ import ( // for it to reach the stopped state. type StepStopMachine struct{} -func (s *StepStopMachine) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepStopMachine) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/triton/step_wait_for_stop_to_not_fail.go b/builder/triton/step_wait_for_stop_to_not_fail.go index d5479c803..ff777d890 100644 --- a/builder/triton/step_wait_for_stop_to_not_fail.go +++ b/builder/triton/step_wait_for_stop_to_not_fail.go @@ -12,7 +12,7 @@ import ( // they are started never actually stop. type StepWaitForStopNotToFail struct{} -func (s *StepWaitForStopNotToFail) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepWaitForStopNotToFail) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) ui.Say("Waiting 10 seconds to avoid potential SDC bug...") time.Sleep(10 * time.Second) diff --git a/builder/virtualbox/common/step_attach_floppy.go b/builder/virtualbox/common/step_attach_floppy.go index 068f7814c..f8c20f3f5 100644 --- a/builder/virtualbox/common/step_attach_floppy.go +++ b/builder/virtualbox/common/step_attach_floppy.go @@ -26,7 +26,7 @@ type StepAttachFloppy struct { floppyPath string } -func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAttachFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { // Determine if we even have a floppy disk to attach var floppyPath string if floppyPathRaw, ok := state.GetOk("floppy_path"); ok { diff --git a/builder/virtualbox/common/step_attach_guest_additions.go b/builder/virtualbox/common/step_attach_guest_additions.go index d9e43e820..c6b88d1c8 100644 --- a/builder/virtualbox/common/step_attach_guest_additions.go +++ b/builder/virtualbox/common/step_attach_guest_additions.go @@ -23,7 +23,7 @@ type StepAttachGuestAdditions struct { GuestAdditionsMode string } -func (s *StepAttachGuestAdditions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepAttachGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_configure_vrdp.go b/builder/virtualbox/common/step_configure_vrdp.go index aa47d586d..2cf2659d8 100644 --- a/builder/virtualbox/common/step_configure_vrdp.go +++ b/builder/virtualbox/common/step_configure_vrdp.go @@ -26,7 +26,7 @@ type StepConfigureVRDP struct { VRDPPortMax uint } -func (s *StepConfigureVRDP) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVRDP) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_download_guest_additions.go b/builder/virtualbox/common/step_download_guest_additions.go index 498d2e71e..750f825e5 100644 --- a/builder/virtualbox/common/step_download_guest_additions.go +++ b/builder/virtualbox/common/step_download_guest_additions.go @@ -36,7 +36,7 @@ type StepDownloadGuestAdditions struct { Ctx interpolate.Context } -func (s *StepDownloadGuestAdditions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDownloadGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { var action multistep.StepAction driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_export.go b/builder/virtualbox/common/step_export.go index 268634132..a09b5c01c 100644 --- a/builder/virtualbox/common/step_export.go +++ b/builder/virtualbox/common/step_export.go @@ -27,7 +27,7 @@ type StepExport struct { SkipExport bool } -func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_forward_ssh.go b/builder/virtualbox/common/step_forward_ssh.go index 7b0a6f903..4bcd2dc66 100644 --- a/builder/virtualbox/common/step_forward_ssh.go +++ b/builder/virtualbox/common/step_forward_ssh.go @@ -27,7 +27,7 @@ type StepForwardSSH struct { SkipNatMapping bool } -func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepForwardSSH) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_output_dir.go b/builder/virtualbox/common/step_output_dir.go index acb905e9a..cad96b98e 100644 --- a/builder/virtualbox/common/step_output_dir.go +++ b/builder/virtualbox/common/step_output_dir.go @@ -21,7 +21,7 @@ type StepOutputDir struct { cleanup bool } -func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) if _, err := os.Stat(s.Path); err == nil { diff --git a/builder/virtualbox/common/step_remove_devices.go b/builder/virtualbox/common/step_remove_devices.go index 0cdde2f23..4a4a24a9e 100644 --- a/builder/virtualbox/common/step_remove_devices.go +++ b/builder/virtualbox/common/step_remove_devices.go @@ -20,7 +20,7 @@ import ( // Produces: type StepRemoveDevices struct{} -func (s *StepRemoveDevices) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRemoveDevices) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_run.go b/builder/virtualbox/common/step_run.go index fc9ee9359..391d8c25e 100644 --- a/builder/virtualbox/common/step_run.go +++ b/builder/virtualbox/common/step_run.go @@ -23,7 +23,7 @@ type StepRun struct { vmName string } -func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/common/step_shutdown.go b/builder/virtualbox/common/step_shutdown.go index 51c435853..7acf97683 100644 --- a/builder/virtualbox/common/step_shutdown.go +++ b/builder/virtualbox/common/step_shutdown.go @@ -29,7 +29,7 @@ type StepShutdown struct { Delay time.Duration } -func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_suppress_messages.go b/builder/virtualbox/common/step_suppress_messages.go index 6ccbe0434..1805a0535 100644 --- a/builder/virtualbox/common/step_suppress_messages.go +++ b/builder/virtualbox/common/step_suppress_messages.go @@ -11,7 +11,7 @@ import ( // pop-up messages don't exist. type StepSuppressMessages struct{} -func (StepSuppressMessages) Run(state multistep.StateBag) multistep.StepAction { +func (StepSuppressMessages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_type_boot_command.go b/builder/virtualbox/common/step_type_boot_command.go index ba008a5a3..997805732 100644 --- a/builder/virtualbox/common/step_type_boot_command.go +++ b/builder/virtualbox/common/step_type_boot_command.go @@ -38,7 +38,7 @@ type StepTypeBootCommand struct { Ctx interpolate.Context } -func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTypeBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { debug := state.Get("debug").(bool) driver := state.Get("driver").(Driver) httpPort := state.Get("http_port").(uint) diff --git a/builder/virtualbox/common/step_upload_guest_additions.go b/builder/virtualbox/common/step_upload_guest_additions.go index 12b646e7e..6de891ffd 100644 --- a/builder/virtualbox/common/step_upload_guest_additions.go +++ b/builder/virtualbox/common/step_upload_guest_additions.go @@ -21,7 +21,7 @@ type StepUploadGuestAdditions struct { Ctx interpolate.Context } -func (s *StepUploadGuestAdditions) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_upload_version.go b/builder/virtualbox/common/step_upload_version.go index 262b6bfad..fa154c7ae 100644 --- a/builder/virtualbox/common/step_upload_version.go +++ b/builder/virtualbox/common/step_upload_version.go @@ -14,7 +14,7 @@ type StepUploadVersion struct { Path string } -func (s *StepUploadVersion) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepUploadVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/common/step_vboxmanage.go b/builder/virtualbox/common/step_vboxmanage.go index 2366cc6ef..54ef96e0f 100644 --- a/builder/virtualbox/common/step_vboxmanage.go +++ b/builder/virtualbox/common/step_vboxmanage.go @@ -27,7 +27,7 @@ type StepVBoxManage struct { Ctx interpolate.Context } -func (s *StepVBoxManage) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepVBoxManage) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) diff --git a/builder/virtualbox/iso/step_attach_iso.go b/builder/virtualbox/iso/step_attach_iso.go index 088241e58..3c9fcc55e 100644 --- a/builder/virtualbox/iso/step_attach_iso.go +++ b/builder/virtualbox/iso/step_attach_iso.go @@ -17,7 +17,7 @@ type stepAttachISO struct { diskPath string } -func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepAttachISO) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) isoPath := state.Get("iso_path").(string) diff --git a/builder/virtualbox/iso/step_create_disk.go b/builder/virtualbox/iso/step_create_disk.go index c5eb71302..cb67af807 100644 --- a/builder/virtualbox/iso/step_create_disk.go +++ b/builder/virtualbox/iso/step_create_disk.go @@ -16,7 +16,7 @@ import ( // hard drive for the virtual machine. type stepCreateDisk struct{} -func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/iso/step_create_vm.go b/builder/virtualbox/iso/step_create_vm.go index 1f14d5b1a..81a8a0304 100644 --- a/builder/virtualbox/iso/step_create_vm.go +++ b/builder/virtualbox/iso/step_create_vm.go @@ -16,7 +16,7 @@ type stepCreateVM struct { vmName string } -func (s *stepCreateVM) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/virtualbox/ovf/step_import.go b/builder/virtualbox/ovf/step_import.go index ca52ef9fc..8ebf5fe4b 100644 --- a/builder/virtualbox/ovf/step_import.go +++ b/builder/virtualbox/ovf/step_import.go @@ -16,7 +16,7 @@ type StepImport struct { vmName string } -func (s *StepImport) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepImport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vboxcommon.Driver) ui := state.Get("ui").(packer.Ui) vmPath := state.Get("vm_path").(string) diff --git a/builder/vmware/common/step_clean_files.go b/builder/vmware/common/step_clean_files.go index d1a970f36..676e08f2f 100644 --- a/builder/vmware/common/step_clean_files.go +++ b/builder/vmware/common/step_clean_files.go @@ -26,7 +26,7 @@ var KeepFileExtensions = []string{".nvram", ".vmdk", ".vmsd", ".vmx", ".vmxf"} // type StepCleanFiles struct{} -func (StepCleanFiles) Run(state multistep.StateBag) multistep.StepAction { +func (StepCleanFiles) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { dir := state.Get("dir").(OutputDir) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_clean_vmx.go b/builder/vmware/common/step_clean_vmx.go index af29ae970..12cc6b223 100644 --- a/builder/vmware/common/step_clean_vmx.go +++ b/builder/vmware/common/step_clean_vmx.go @@ -24,7 +24,7 @@ type StepCleanVMX struct { VNCEnabled bool } -func (s StepCleanVMX) Run(state multistep.StateBag) multistep.StepAction { +func (s StepCleanVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_compact_disk.go b/builder/vmware/common/step_compact_disk.go index 9292c46cf..cf0c4cf19 100644 --- a/builder/vmware/common/step_compact_disk.go +++ b/builder/vmware/common/step_compact_disk.go @@ -21,7 +21,7 @@ type StepCompactDisk struct { Skip bool } -func (s StepCompactDisk) Run(state multistep.StateBag) multistep.StepAction { +func (s StepCompactDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) full_disk_path := state.Get("full_disk_path").(string) diff --git a/builder/vmware/common/step_configure_vmx.go b/builder/vmware/common/step_configure_vmx.go index 2b3f605f8..369712b6e 100644 --- a/builder/vmware/common/step_configure_vmx.go +++ b/builder/vmware/common/step_configure_vmx.go @@ -21,7 +21,7 @@ type StepConfigureVMX struct { SkipFloppy bool } -func (s *StepConfigureVMX) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_configure_vnc.go b/builder/vmware/common/step_configure_vnc.go index e8b9f9a9f..1f18ce5bf 100644 --- a/builder/vmware/common/step_configure_vnc.go +++ b/builder/vmware/common/step_configure_vnc.go @@ -76,7 +76,7 @@ func VNCPassword(skipPassword bool) string { return string(password) } -func (s *StepConfigureVNC) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConfigureVNC) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if !s.Enabled { log.Println("Skipping VNC configuration step...") return multistep.ActionContinue diff --git a/builder/vmware/common/step_output_dir.go b/builder/vmware/common/step_output_dir.go index ed180ed11..35effe138 100644 --- a/builder/vmware/common/step_output_dir.go +++ b/builder/vmware/common/step_output_dir.go @@ -18,7 +18,7 @@ type StepOutputDir struct { success bool } -func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepOutputDir) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { dir := state.Get("dir").(OutputDir) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/common/step_prepare_tools.go b/builder/vmware/common/step_prepare_tools.go index 6dfabc663..3ce771387 100644 --- a/builder/vmware/common/step_prepare_tools.go +++ b/builder/vmware/common/step_prepare_tools.go @@ -12,7 +12,7 @@ type StepPrepareTools struct { ToolsUploadFlavor string } -func (c *StepPrepareTools) Run(state multistep.StateBag) multistep.StepAction { +func (c *StepPrepareTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if c.RemoteType == "esx5" { diff --git a/builder/vmware/common/step_run.go b/builder/vmware/common/step_run.go index 0324937fb..14334e779 100644 --- a/builder/vmware/common/step_run.go +++ b/builder/vmware/common/step_run.go @@ -26,7 +26,7 @@ type StepRun struct { vmxPath string } -func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_run_test.go b/builder/vmware/common/step_run_test.go index 961363a04..395575231 100644 --- a/builder/vmware/common/step_run_test.go +++ b/builder/vmware/common/step_run_test.go @@ -10,7 +10,7 @@ func TestStepRun_impl(t *testing.T) { var _ multistep.Step = new(StepRun) } -func TestStepRun(t *testing.T) { +func TestStepRun(_ context.Context, t *testing.T) { state := testState(t) step := new(StepRun) diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index 2938eabe4..5067ebbb2 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -35,7 +35,7 @@ type StepShutdown struct { Testing bool } -func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) dir := state.Get("dir").(OutputDir) driver := state.Get("driver").(Driver) diff --git a/builder/vmware/common/step_suppress_messages.go b/builder/vmware/common/step_suppress_messages.go index 425da1398..3e8721dec 100644 --- a/builder/vmware/common/step_suppress_messages.go +++ b/builder/vmware/common/step_suppress_messages.go @@ -10,7 +10,7 @@ import ( // This step suppresses any messages that VMware product might show. type StepSuppressMessages struct{} -func (s *StepSuppressMessages) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepSuppressMessages) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/common/step_type_boot_command.go b/builder/vmware/common/step_type_boot_command.go index 84b47045e..8e6a66366 100644 --- a/builder/vmware/common/step_type_boot_command.go +++ b/builder/vmware/common/step_type_boot_command.go @@ -42,7 +42,7 @@ type StepTypeBootCommand struct { Ctx interpolate.Context } -func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepTypeBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if !s.VNCEnabled { log.Println("Skipping boot command step...") return multistep.ActionContinue diff --git a/builder/vmware/common/step_upload_tools.go b/builder/vmware/common/step_upload_tools.go index c3642a1e6..4dff6496e 100644 --- a/builder/vmware/common/step_upload_tools.go +++ b/builder/vmware/common/step_upload_tools.go @@ -20,7 +20,7 @@ type StepUploadTools struct { Ctx interpolate.Context } -func (c *StepUploadTools) Run(state multistep.StateBag) multistep.StepAction { +func (c *StepUploadTools) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(Driver) if c.ToolsUploadFlavor == "" { diff --git a/builder/vmware/iso/step_create_disk.go b/builder/vmware/iso/step_create_disk.go index 1d76e68f5..457236034 100644 --- a/builder/vmware/iso/step_create_disk.go +++ b/builder/vmware/iso/step_create_disk.go @@ -21,7 +21,7 @@ import ( // full_disk_path (string) - The full path to the created disk. type stepCreateDisk struct{} -func (stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { +func (stepCreateDisk) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index 3a8985394..a071ed0f1 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -38,7 +38,7 @@ type stepCreateVMX struct { tempDir string } -func (s *stepCreateVMX) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(*Config) isoPath := state.Get("iso_path").(string) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index 3fa71d8d8..4d08af159 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -34,7 +34,7 @@ func (s *StepExport) generateArgs(c *Config, hidePassword bool) []string { return append(c.OVFToolOptions, args...) } -func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepExport) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_register.go b/builder/vmware/iso/step_register.go index a11ef17b5..e1d396ab1 100644 --- a/builder/vmware/iso/step_register.go +++ b/builder/vmware/iso/step_register.go @@ -14,7 +14,7 @@ type StepRegister struct { Format string } -func (s *StepRegister) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepRegister) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) vmxPath := state.Get("vmx_path").(string) diff --git a/builder/vmware/iso/step_remote_upload.go b/builder/vmware/iso/step_remote_upload.go index 48deabaab..427ba28c6 100644 --- a/builder/vmware/iso/step_remote_upload.go +++ b/builder/vmware/iso/step_remote_upload.go @@ -17,7 +17,7 @@ type stepRemoteUpload struct { Message string } -func (s *stepRemoteUpload) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepRemoteUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/iso/step_upload_vmx.go b/builder/vmware/iso/step_upload_vmx.go index 2fc65daaf..360372765 100644 --- a/builder/vmware/iso/step_upload_vmx.go +++ b/builder/vmware/iso/step_upload_vmx.go @@ -23,7 +23,7 @@ type StepUploadVMX struct { RemoteType string } -func (c *StepUploadVMX) Run(state multistep.StateBag) multistep.StepAction { +func (c *StepUploadVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/builder/vmware/vmx/step_clone_vmx.go b/builder/vmware/vmx/step_clone_vmx.go index 76318b2ef..e65ea0dca 100644 --- a/builder/vmware/vmx/step_clone_vmx.go +++ b/builder/vmware/vmx/step_clone_vmx.go @@ -17,7 +17,7 @@ type StepCloneVMX struct { VMName string } -func (s *StepCloneVMX) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCloneVMX) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(vmwcommon.Driver) ui := state.Get("ui").(packer.Ui) diff --git a/common/step_create_floppy.go b/common/step_create_floppy.go index fdcc29f64..8b0ef8b83 100644 --- a/common/step_create_floppy.go +++ b/common/step_create_floppy.go @@ -26,7 +26,7 @@ type StepCreateFloppy struct { FilesAdded map[string]bool } -func (s *StepCreateFloppy) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepCreateFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { if len(s.Files) == 0 && len(s.Directories) == 0 { log.Println("No floppy files specified. Floppy disk will not be made.") return multistep.ActionContinue diff --git a/common/step_download.go b/common/step_download.go index d0250ec34..bdcd7ac65 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -45,7 +45,7 @@ type StepDownload struct { Extension string } -func (s *StepDownload) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { cache := state.Get("cache").(packer.Cache) ui := state.Get("ui").(packer.Ui) diff --git a/common/step_http_server.go b/common/step_http_server.go index b7fd3dcfd..70b1e1460 100644 --- a/common/step_http_server.go +++ b/common/step_http_server.go @@ -31,7 +31,7 @@ type StepHTTPServer struct { l net.Listener } -func (s *StepHTTPServer) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepHTTPServer) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var httpPort uint = 0 diff --git a/common/step_provision.go b/common/step_provision.go index a859fea7d..971ef97fb 100644 --- a/common/step_provision.go +++ b/common/step_provision.go @@ -23,7 +23,7 @@ type StepProvision struct { Comm packer.Communicator } -func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepProvision) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { comm := s.Comm if comm == nil { raw, ok := state.Get("communicator").(packer.Communicator) diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index 5f27b0765..67a5eebbe 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -43,7 +43,7 @@ type StepConnect struct { substep multistep.Step } -func (s *StepConnect) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { typeMap := map[string]multistep.Step{ "none": nil, "ssh": &StepConnectSSH{ diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 842e5e611..2f3ae3666 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -29,7 +29,7 @@ type StepConnectSSH struct { SSHPort func(multistep.StateBag) (int, error) } -func (s *StepConnectSSH) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConnectSSH) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var comm packer.Communicator diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index b1182f7d6..97e7805d6 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -32,7 +32,7 @@ type StepConnectWinRM struct { WinRMPort func(multistep.StateBag) (int, error) } -func (s *StepConnectWinRM) Run(state multistep.StateBag) multistep.StepAction { +func (s *StepConnectWinRM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) var comm packer.Communicator diff --git a/post-processor/vagrant-cloud/step_create_provider.go b/post-processor/vagrant-cloud/step_create_provider.go index 3e43bf451..028e5c6c7 100644 --- a/post-processor/vagrant-cloud/step_create_provider.go +++ b/post-processor/vagrant-cloud/step_create_provider.go @@ -17,7 +17,7 @@ type stepCreateProvider struct { name string // the name of the provider } -func (s *stepCreateProvider) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateProvider) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_create_version.go b/post-processor/vagrant-cloud/step_create_version.go index 6a7ef9fa7..d8e6b9df8 100644 --- a/post-processor/vagrant-cloud/step_create_version.go +++ b/post-processor/vagrant-cloud/step_create_version.go @@ -14,7 +14,7 @@ type Version struct { type stepCreateVersion struct { } -func (s *stepCreateVersion) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/post-processor/vagrant-cloud/step_prepare_upload.go b/post-processor/vagrant-cloud/step_prepare_upload.go index 88fa1eb05..1bcc05885 100644 --- a/post-processor/vagrant-cloud/step_prepare_upload.go +++ b/post-processor/vagrant-cloud/step_prepare_upload.go @@ -14,7 +14,7 @@ type Upload struct { type stepPrepareUpload struct { } -func (s *stepPrepareUpload) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepPrepareUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_release_version.go b/post-processor/vagrant-cloud/step_release_version.go index 328819570..5f7fbb0f0 100644 --- a/post-processor/vagrant-cloud/step_release_version.go +++ b/post-processor/vagrant-cloud/step_release_version.go @@ -11,7 +11,7 @@ import ( type stepReleaseVersion struct { } -func (s *stepReleaseVersion) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepReleaseVersion) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) box := state.Get("box").(*Box) diff --git a/post-processor/vagrant-cloud/step_upload.go b/post-processor/vagrant-cloud/step_upload.go index 78d3bac0a..576558b24 100644 --- a/post-processor/vagrant-cloud/step_upload.go +++ b/post-processor/vagrant-cloud/step_upload.go @@ -12,7 +12,7 @@ import ( type stepUpload struct { } -func (s *stepUpload) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepUpload) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) upload := state.Get("upload").(*Upload) diff --git a/post-processor/vagrant-cloud/step_verify_box.go b/post-processor/vagrant-cloud/step_verify_box.go index 84f12b6fe..baee6222a 100644 --- a/post-processor/vagrant-cloud/step_verify_box.go +++ b/post-processor/vagrant-cloud/step_verify_box.go @@ -23,7 +23,7 @@ func (b *Box) HasVersion(version string) (bool, *Version) { type stepVerifyBox struct { } -func (s *stepVerifyBox) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepVerifyBox) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packer.Ui) config := state.Get("config").(Config) diff --git a/post-processor/vsphere-template/step_choose_datacenter.go b/post-processor/vsphere-template/step_choose_datacenter.go index f66d99d9f..450f2b946 100644 --- a/post-processor/vsphere-template/step_choose_datacenter.go +++ b/post-processor/vsphere-template/step_choose_datacenter.go @@ -13,7 +13,7 @@ type stepChooseDatacenter struct { Datacenter string } -func (s *stepChooseDatacenter) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepChooseDatacenter) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) finder := find.NewFinder(cli.Client, false) diff --git a/post-processor/vsphere-template/step_create_folder.go b/post-processor/vsphere-template/step_create_folder.go index cf5b8a847..49232c2f2 100644 --- a/post-processor/vsphere-template/step_create_folder.go +++ b/post-processor/vsphere-template/step_create_folder.go @@ -15,7 +15,7 @@ type stepCreateFolder struct { Folder string } -func (s *stepCreateFolder) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepCreateFolder) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) dcPath := state.Get("dcPath").(string) diff --git a/post-processor/vsphere-template/step_mark_as_template.go b/post-processor/vsphere-template/step_mark_as_template.go index a8a116028..8117a4940 100644 --- a/post-processor/vsphere-template/step_mark_as_template.go +++ b/post-processor/vsphere-template/step_mark_as_template.go @@ -18,7 +18,7 @@ type stepMarkAsTemplate struct { VMName string } -func (s *stepMarkAsTemplate) Run(state multistep.StateBag) multistep.StepAction { +func (s *stepMarkAsTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) cli := state.Get("client").(*govmomi.Client) folder := state.Get("folder").(*object.Folder) From 7a189a83a19c1acabbcdb505120653e0aa77ea46 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 15:32:33 -0800 Subject: [PATCH 11/19] fix imports `find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports -w {} \;` --- builder/alicloud/ecs/step_attach_keypair.go | 2 +- builder/alicloud/ecs/step_check_source_image.go | 1 + builder/alicloud/ecs/step_config_eip.go | 1 + builder/alicloud/ecs/step_config_key_pair.go | 1 + builder/alicloud/ecs/step_config_public_ip.go | 1 + builder/alicloud/ecs/step_config_security_group.go | 1 + builder/alicloud/ecs/step_config_vpc.go | 1 + builder/alicloud/ecs/step_config_vswitch.go | 1 + builder/alicloud/ecs/step_create_image.go | 1 + builder/alicloud/ecs/step_create_instance.go | 1 + builder/alicloud/ecs/step_delete_images_snapshots.go | 1 + builder/alicloud/ecs/step_mount_disk.go | 1 + builder/alicloud/ecs/step_pre_validate.go | 1 + builder/alicloud/ecs/step_region_copy_image.go | 1 + builder/alicloud/ecs/step_run_instance.go | 1 + builder/alicloud/ecs/step_share_image.go | 1 + builder/alicloud/ecs/step_stop_instance.go | 1 + builder/amazon/chroot/step_attach_volume.go | 1 + builder/amazon/chroot/step_check_root_device.go | 1 + builder/amazon/chroot/step_chroot_provision.go | 1 + builder/amazon/chroot/step_copy_files.go | 5 ++--- builder/amazon/chroot/step_create_volume.go | 1 + builder/amazon/chroot/step_early_cleanup.go | 4 +++- builder/amazon/chroot/step_early_unflock.go | 4 +++- builder/amazon/chroot/step_flock.go | 5 ++--- builder/amazon/chroot/step_instance_info.go | 1 + builder/amazon/chroot/step_mount_device.go | 1 + builder/amazon/chroot/step_mount_extra.go | 5 ++--- builder/amazon/chroot/step_post_mount_commands.go | 2 ++ builder/amazon/chroot/step_pre_mount_commands.go | 2 ++ builder/amazon/chroot/step_prepare_device.go | 1 + builder/amazon/chroot/step_register_ami.go | 1 + builder/amazon/chroot/step_snapshot.go | 1 + builder/amazon/common/step_ami_region_copy.go | 1 + builder/amazon/common/step_create_tags.go | 1 + builder/amazon/common/step_deregister_ami.go | 1 + builder/amazon/common/step_encrypted_ami.go | 1 + builder/amazon/common/step_get_password.go | 1 + builder/amazon/common/step_key_pair.go | 1 + builder/amazon/common/step_modify_ami_attributes.go | 1 + builder/amazon/common/step_modify_ebs_instance.go | 1 + builder/amazon/common/step_pre_validate.go | 1 + builder/amazon/common/step_run_spot_instance.go | 1 + builder/amazon/common/step_security_group.go | 1 + builder/amazon/common/step_source_ami_info.go | 1 + builder/amazon/common/step_stop_ebs_instance.go | 1 + builder/amazon/ebs/step_cleanup_volumes.go | 1 + builder/amazon/ebs/step_create_ami.go | 1 + builder/amazon/ebssurrogate/step_register_ami.go | 1 + builder/amazon/ebssurrogate/step_snapshot_new_root.go | 1 + builder/amazon/ebsvolume/step_tag_ebs_volumes.go | 1 + builder/amazon/instance/step_bundle_volume.go | 1 + builder/amazon/instance/step_register_ami.go | 1 + builder/amazon/instance/step_upload_bundle.go | 1 + builder/amazon/instance/step_upload_x509_cert.go | 4 +++- builder/azure/arm/step_capture_image.go | 1 + builder/azure/arm/step_create_resource_group.go | 1 + builder/azure/arm/step_delete_os_disk.go | 1 + builder/azure/arm/step_delete_resource_group.go | 1 + builder/azure/arm/step_deploy_template.go | 1 + builder/azure/arm/step_get_certificate.go | 1 + builder/azure/arm/step_get_ip_address.go | 1 + builder/azure/arm/step_get_os_disk.go | 1 + builder/azure/arm/step_power_off_compute.go | 1 + builder/azure/arm/step_set_certificate.go | 2 ++ builder/azure/arm/step_test.go | 1 - builder/azure/arm/step_validate_template.go | 1 + builder/azure/common/lin/step_create_cert.go | 1 + builder/azure/common/lin/step_generalize_os.go | 4 +++- builder/cloudstack/step_configure_networking.go | 1 + builder/cloudstack/step_create_instance.go | 1 + builder/cloudstack/step_create_security_group.go | 1 + builder/cloudstack/step_create_template.go | 1 + builder/cloudstack/step_keypair.go | 1 + builder/cloudstack/step_prepare_config.go | 1 + builder/cloudstack/step_shutdown_instance.go | 1 + builder/docker/step_commit.go | 2 ++ builder/docker/step_commit_test.go | 3 +-- builder/docker/step_connect_docker.go | 4 ++-- builder/docker/step_export.go | 1 + builder/docker/step_export_test.go | 3 +-- builder/docker/step_pull.go | 1 + builder/docker/step_pull_test.go | 3 +-- builder/docker/step_run.go | 2 ++ builder/docker/step_run_test.go | 4 ++-- builder/docker/step_temp_dir.go | 5 ++--- builder/docker/step_test.go | 3 ++- builder/googlecompute/step_check_existing_image.go | 1 + builder/googlecompute/step_check_existing_image_test.go | 3 +-- builder/googlecompute/step_create_image.go | 1 + builder/googlecompute/step_create_instance.go | 1 + builder/googlecompute/step_create_ssh_key.go | 1 + builder/googlecompute/step_create_windows_password.go | 1 + builder/googlecompute/step_instance_info.go | 1 + builder/googlecompute/step_instance_info_test.go | 3 +-- builder/googlecompute/step_teardown_instance.go | 1 + builder/googlecompute/step_teardown_instance_test.go | 3 +-- builder/googlecompute/step_wait_startup_script.go | 1 + builder/googlecompute/step_wait_startup_script_test.go | 2 ++ builder/hyperv/common/step_clone_vm.go | 1 + builder/hyperv/common/step_configure_ip.go | 1 + builder/hyperv/common/step_configure_vlan.go | 1 + builder/hyperv/common/step_create_external_switch.go | 1 + builder/hyperv/common/step_create_switch.go | 2 ++ builder/hyperv/common/step_create_tempdir.go | 1 + builder/hyperv/common/step_create_vm.go | 1 + builder/hyperv/common/step_disable_vlan.go | 2 ++ builder/hyperv/common/step_enable_integration_service.go | 2 ++ builder/hyperv/common/step_export_vm.go | 1 + builder/hyperv/common/step_mount_dvddrive.go | 5 ++--- builder/hyperv/common/step_mount_floppydrive.go | 5 ++--- builder/hyperv/common/step_mount_guest_additions.go | 4 +++- builder/hyperv/common/step_mount_secondary_dvd_images.go | 4 +++- builder/hyperv/common/step_output_dir.go | 1 + builder/hyperv/common/step_polling_installation.go | 1 + builder/hyperv/common/step_reboot_vm.go | 4 +++- builder/hyperv/common/step_run.go | 4 +++- builder/hyperv/common/step_shutdown.go | 1 + builder/hyperv/common/step_sleep.go | 4 +++- builder/hyperv/common/step_type_boot_command.go | 1 + builder/hyperv/common/step_unmount_dvddrive.go | 2 ++ builder/hyperv/common/step_unmount_floppydrive.go | 2 ++ builder/hyperv/common/step_unmount_guest_additions.go | 2 ++ builder/hyperv/common/step_unmount_secondary_dvd_images.go | 2 ++ builder/hyperv/common/step_wait_for_install_to_complete.go | 4 +++- builder/hyperv/iso/builder_test.go | 1 - builder/hyperv/vmcx/builder_test.go | 2 -- builder/lxc/builder.go | 3 --- builder/lxc/step_export.go | 5 ++--- builder/lxc/step_lxc_create.go | 5 ++--- builder/lxc/step_prepare_output_dir.go | 5 ++--- builder/lxc/step_provision.go | 4 +++- builder/lxc/step_wait_init.go | 5 ++--- builder/lxd/builder.go | 1 - builder/lxd/step_lxd_launch.go | 4 +++- builder/lxd/step_provision.go | 4 +++- builder/lxd/step_publish.go | 4 +++- builder/oneandone/builder.go | 1 - builder/oneandone/step_create_server.go | 3 +-- builder/oneandone/step_create_sshkey.go | 3 +++ builder/oneandone/step_take_snapshot.go | 2 ++ builder/openstack/step_add_image_members.go | 1 + builder/openstack/step_allocate_ip.go | 1 + builder/openstack/step_create_image.go | 1 + builder/openstack/step_get_password.go | 1 + builder/openstack/step_key_pair.go | 1 + builder/openstack/step_load_extensions.go | 1 + builder/openstack/step_load_flavor.go | 1 + builder/openstack/step_run_source_server.go | 1 + builder/openstack/step_stop_server.go | 1 + builder/openstack/step_update_image_visibility.go | 1 + builder/openstack/step_wait_for_rackconnect.go | 1 + builder/oracle/oci/step_create_instance.go | 1 + builder/oracle/oci/step_image.go | 1 + builder/oracle/oci/step_instance_info.go | 1 + builder/oracle/oci/step_ssh_key_pair.go | 1 + builder/parallels/common/step_attach_floppy.go | 1 + builder/parallels/common/step_attach_parallels_tools.go | 1 + builder/parallels/common/step_compact_disk.go | 1 + builder/parallels/common/step_output_dir.go | 1 + builder/parallels/common/step_prepare_parallels_tools.go | 1 + builder/parallels/common/step_prlctl.go | 1 + builder/parallels/common/step_run.go | 1 + builder/parallels/common/step_shutdown.go | 1 + builder/parallels/common/step_type_boot_command.go | 1 + builder/parallels/common/step_upload_parallels_tools.go | 1 + builder/parallels/common/step_upload_version.go | 1 + builder/parallels/iso/step_attach_iso.go | 1 + builder/parallels/iso/step_create_disk.go | 1 + builder/parallels/iso/step_create_vm.go | 1 + builder/parallels/iso/step_set_boot_order.go | 1 + builder/parallels/pvm/step_import.go | 1 + builder/profitbricks/builder.go | 1 - builder/profitbricks/step_create_server.go | 1 + builder/profitbricks/step_create_ssh_key.go | 3 +++ builder/profitbricks/step_take_snapshot.go | 1 + builder/qemu/step_boot_wait.go | 4 +++- builder/qemu/step_configure_vnc.go | 1 + builder/qemu/step_convert_disk.go | 1 + builder/qemu/step_copy_disk.go | 1 + builder/qemu/step_create_disk.go | 1 + builder/qemu/step_forward_ssh.go | 1 + builder/qemu/step_prepare_output_dir.go | 5 ++--- builder/qemu/step_resize_disk.go | 1 + builder/qemu/step_run.go | 1 + builder/qemu/step_set_iso.go | 1 + builder/qemu/step_shutdown.go | 1 + builder/qemu/step_type_boot_command.go | 2 +- builder/triton/step_create_image_from_machine.go | 1 + builder/triton/step_create_source_machine.go | 1 + builder/triton/step_delete_machine.go | 1 + builder/triton/step_stop_machine.go | 1 + builder/triton/step_test.go | 3 ++- builder/triton/step_wait_for_stop_to_not_fail.go | 1 + builder/virtualbox/common/step_attach_floppy.go | 5 ++--- builder/virtualbox/common/step_attach_floppy_test.go | 3 +-- builder/virtualbox/common/step_attach_guest_additions.go | 4 +++- builder/virtualbox/common/step_configure_vrdp.go | 1 + builder/virtualbox/common/step_download_guest_additions.go | 1 + builder/virtualbox/common/step_export.go | 5 ++--- builder/virtualbox/common/step_export_test.go | 3 +-- builder/virtualbox/common/step_forward_ssh.go | 1 + builder/virtualbox/common/step_output_dir.go | 1 + builder/virtualbox/common/step_output_dir_test.go | 3 +-- builder/virtualbox/common/step_remove_devices.go | 1 + builder/virtualbox/common/step_remove_devices_test.go | 3 +-- builder/virtualbox/common/step_run.go | 1 + builder/virtualbox/common/step_shutdown.go | 5 ++--- builder/virtualbox/common/step_shutdown_test.go | 4 +--- builder/virtualbox/common/step_suppress_messages.go | 4 +++- builder/virtualbox/common/step_suppress_messages_test.go | 3 +-- builder/virtualbox/common/step_test.go | 3 ++- builder/virtualbox/common/step_type_boot_command.go | 1 + builder/virtualbox/common/step_upload_guest_additions.go | 1 + builder/virtualbox/common/step_upload_version.go | 4 +++- builder/virtualbox/common/step_upload_version_test.go | 3 ++- builder/virtualbox/common/step_vboxmanage.go | 1 + builder/virtualbox/iso/step_attach_iso.go | 1 + builder/virtualbox/iso/step_create_disk.go | 1 + builder/virtualbox/iso/step_create_vm.go | 1 + builder/virtualbox/ovf/step_import.go | 1 + builder/virtualbox/ovf/step_import_test.go | 1 - builder/virtualbox/ovf/step_test.go | 1 - builder/vmware/common/step_clean_files.go | 5 ++--- builder/vmware/common/step_clean_vmx.go | 1 + builder/vmware/common/step_compact_disk.go | 4 +++- builder/vmware/common/step_configure_vmx.go | 1 + builder/vmware/common/step_configure_vnc.go | 1 + builder/vmware/common/step_output_dir.go | 1 + builder/vmware/common/step_output_dir_test.go | 3 +-- builder/vmware/common/step_prepare_tools.go | 1 + builder/vmware/common/step_run.go | 1 + builder/vmware/common/step_run_test.go | 1 + builder/vmware/common/step_shutdown.go | 5 ++--- builder/vmware/common/step_suppress_messages.go | 4 +++- builder/vmware/common/step_test.go | 3 ++- builder/vmware/common/step_type_boot_command.go | 1 + builder/vmware/common/step_upload_tools.go | 1 + builder/vmware/iso/step_create_disk.go | 2 +- builder/vmware/iso/step_create_vmx.go | 1 + builder/vmware/iso/step_export.go | 1 + builder/vmware/iso/step_export_test.go | 3 +-- builder/vmware/iso/step_register.go | 1 + builder/vmware/iso/step_register_test.go | 3 +-- builder/vmware/iso/step_remote_upload.go | 2 +- builder/vmware/iso/step_test.go | 1 - builder/vmware/iso/step_upload_vmx.go | 2 +- builder/vmware/vmx/step_clone_vmx.go | 1 + common/multistep_debug.go | 4 +--- common/step_create_floppy.go | 1 + common/step_create_floppy_test.go | 4 +--- common/step_download.go | 1 + common/step_download_test.go | 3 +-- common/step_http_server.go | 1 + common/step_provision.go | 5 ++--- common/step_provision_test.go | 3 +-- helper/communicator/step_connect.go | 1 + helper/communicator/step_connect_ssh.go | 1 + helper/communicator/step_connect_winrm.go | 1 + post-processor/vagrant-cloud/step_create_provider.go | 2 ++ post-processor/vagrant-cloud/step_create_version.go | 2 ++ post-processor/vagrant-cloud/step_prepare_upload.go | 1 + post-processor/vagrant-cloud/step_release_version.go | 1 + post-processor/vagrant-cloud/step_upload.go | 1 + post-processor/vagrant-cloud/step_verify_box.go | 2 ++ 265 files changed, 340 insertions(+), 141 deletions(-) diff --git a/builder/alicloud/ecs/step_attach_keypair.go b/builder/alicloud/ecs/step_attach_keypair.go index 1bb901f98..8fa2eedfb 100644 --- a/builder/alicloud/ecs/step_attach_keypair.go +++ b/builder/alicloud/ecs/step_attach_keypair.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "time" @@ -9,7 +10,6 @@ import ( "github.com/denverdino/aliyungo/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) type stepAttachKeyPar struct { diff --git a/builder/alicloud/ecs/step_check_source_image.go b/builder/alicloud/ecs/step_check_source_image.go index b9dc58f69..6090d8868 100644 --- a/builder/alicloud/ecs/step_check_source_image.go +++ b/builder/alicloud/ecs/step_check_source_image.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_config_eip.go b/builder/alicloud/ecs/step_config_eip.go index edf0b2748..c9446bc47 100644 --- a/builder/alicloud/ecs/step_config_eip.go +++ b/builder/alicloud/ecs/step_config_eip.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_config_key_pair.go b/builder/alicloud/ecs/step_config_key_pair.go index 9c68ce92e..e49ae65fb 100644 --- a/builder/alicloud/ecs/step_config_key_pair.go +++ b/builder/alicloud/ecs/step_config_key_pair.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "io/ioutil" "os" diff --git a/builder/alicloud/ecs/step_config_public_ip.go b/builder/alicloud/ecs/step_config_public_ip.go index e87a20079..7e0a246e0 100644 --- a/builder/alicloud/ecs/step_config_public_ip.go +++ b/builder/alicloud/ecs/step_config_public_ip.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/ecs" diff --git a/builder/alicloud/ecs/step_config_security_group.go b/builder/alicloud/ecs/step_config_security_group.go index 4414eefe6..951f6e6fe 100644 --- a/builder/alicloud/ecs/step_config_security_group.go +++ b/builder/alicloud/ecs/step_config_security_group.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "errors" "fmt" "time" diff --git a/builder/alicloud/ecs/step_config_vpc.go b/builder/alicloud/ecs/step_config_vpc.go index 618b4a3da..36d52838f 100644 --- a/builder/alicloud/ecs/step_config_vpc.go +++ b/builder/alicloud/ecs/step_config_vpc.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "errors" "fmt" "time" diff --git a/builder/alicloud/ecs/step_config_vswitch.go b/builder/alicloud/ecs/step_config_vswitch.go index 5510acb3b..c1494e9d0 100644 --- a/builder/alicloud/ecs/step_config_vswitch.go +++ b/builder/alicloud/ecs/step_config_vswitch.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "errors" "fmt" "time" diff --git a/builder/alicloud/ecs/step_create_image.go b/builder/alicloud/ecs/step_create_image.go index 098323307..ae5840c09 100644 --- a/builder/alicloud/ecs/step_create_image.go +++ b/builder/alicloud/ecs/step_create_image.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_create_instance.go b/builder/alicloud/ecs/step_create_instance.go index 694ee0046..5001fe4df 100644 --- a/builder/alicloud/ecs/step_create_instance.go +++ b/builder/alicloud/ecs/step_create_instance.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "io/ioutil" "log" diff --git a/builder/alicloud/ecs/step_delete_images_snapshots.go b/builder/alicloud/ecs/step_delete_images_snapshots.go index 39e56e7bd..d3f6139f0 100644 --- a/builder/alicloud/ecs/step_delete_images_snapshots.go +++ b/builder/alicloud/ecs/step_delete_images_snapshots.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "log" diff --git a/builder/alicloud/ecs/step_mount_disk.go b/builder/alicloud/ecs/step_mount_disk.go index 509d06615..642605bee 100644 --- a/builder/alicloud/ecs/step_mount_disk.go +++ b/builder/alicloud/ecs/step_mount_disk.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/ecs" diff --git a/builder/alicloud/ecs/step_pre_validate.go b/builder/alicloud/ecs/step_pre_validate.go index bdcad2756..6bc3b1060 100644 --- a/builder/alicloud/ecs/step_pre_validate.go +++ b/builder/alicloud/ecs/step_pre_validate.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_region_copy_image.go b/builder/alicloud/ecs/step_region_copy_image.go index e50398539..dddf08488 100644 --- a/builder/alicloud/ecs/step_region_copy_image.go +++ b/builder/alicloud/ecs/step_region_copy_image.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_run_instance.go b/builder/alicloud/ecs/step_run_instance.go index 2bac6dc91..72491dd1d 100644 --- a/builder/alicloud/ecs/step_run_instance.go +++ b/builder/alicloud/ecs/step_run_instance.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/ecs" diff --git a/builder/alicloud/ecs/step_share_image.go b/builder/alicloud/ecs/step_share_image.go index 2f6fbf06f..f954eb421 100644 --- a/builder/alicloud/ecs/step_share_image.go +++ b/builder/alicloud/ecs/step_share_image.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/common" diff --git a/builder/alicloud/ecs/step_stop_instance.go b/builder/alicloud/ecs/step_stop_instance.go index 055f0d5d9..d57a52c12 100644 --- a/builder/alicloud/ecs/step_stop_instance.go +++ b/builder/alicloud/ecs/step_stop_instance.go @@ -1,6 +1,7 @@ package ecs import ( + "context" "fmt" "github.com/denverdino/aliyungo/ecs" diff --git a/builder/amazon/chroot/step_attach_volume.go b/builder/amazon/chroot/step_attach_volume.go index f386a031b..01ab32464 100644 --- a/builder/amazon/chroot/step_attach_volume.go +++ b/builder/amazon/chroot/step_attach_volume.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "errors" "fmt" "strings" diff --git a/builder/amazon/chroot/step_check_root_device.go b/builder/amazon/chroot/step_check_root_device.go index 582a76b8d..5ff66d055 100644 --- a/builder/amazon/chroot/step_check_root_device.go +++ b/builder/amazon/chroot/step_check_root_device.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "fmt" "github.com/aws/aws-sdk-go/service/ec2" diff --git a/builder/amazon/chroot/step_chroot_provision.go b/builder/amazon/chroot/step_chroot_provision.go index 6eb4226c5..be8667077 100644 --- a/builder/amazon/chroot/step_chroot_provision.go +++ b/builder/amazon/chroot/step_chroot_provision.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "log" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go index d1bdb32b4..a973a5d81 100644 --- a/builder/amazon/chroot/step_copy_files.go +++ b/builder/amazon/chroot/step_copy_files.go @@ -2,14 +2,13 @@ package chroot import ( "bytes" + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepCopyFiles copies some files from the host into the chroot environment. diff --git a/builder/amazon/chroot/step_create_volume.go b/builder/amazon/chroot/step_create_volume.go index 10f49b0df..b3c205b26 100644 --- a/builder/amazon/chroot/step_create_volume.go +++ b/builder/amazon/chroot/step_create_volume.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "fmt" "log" diff --git a/builder/amazon/chroot/step_early_cleanup.go b/builder/amazon/chroot/step_early_cleanup.go index 449cb2a89..34e7817df 100644 --- a/builder/amazon/chroot/step_early_cleanup.go +++ b/builder/amazon/chroot/step_early_cleanup.go @@ -1,10 +1,12 @@ package chroot import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // StepEarlyCleanup performs some of the cleanup steps early in order to diff --git a/builder/amazon/chroot/step_early_unflock.go b/builder/amazon/chroot/step_early_unflock.go index 8c15713f8..225e91fb9 100644 --- a/builder/amazon/chroot/step_early_unflock.go +++ b/builder/amazon/chroot/step_early_unflock.go @@ -1,10 +1,12 @@ package chroot import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // StepEarlyUnflock unlocks the flock. diff --git a/builder/amazon/chroot/step_flock.go b/builder/amazon/chroot/step_flock.go index d7ef614ff..d75adc7f0 100644 --- a/builder/amazon/chroot/step_flock.go +++ b/builder/amazon/chroot/step_flock.go @@ -1,15 +1,14 @@ package chroot import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepFlock provisions the instance within a chroot. diff --git a/builder/amazon/chroot/step_instance_info.go b/builder/amazon/chroot/step_instance_info.go index 8811a49ff..558e28a8d 100644 --- a/builder/amazon/chroot/step_instance_info.go +++ b/builder/amazon/chroot/step_instance_info.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "fmt" "log" diff --git a/builder/amazon/chroot/step_mount_device.go b/builder/amazon/chroot/step_mount_device.go index 06fae4210..f9fc7b0a8 100644 --- a/builder/amazon/chroot/step_mount_device.go +++ b/builder/amazon/chroot/step_mount_device.go @@ -2,6 +2,7 @@ package chroot import ( "bytes" + "context" "fmt" "log" "os" diff --git a/builder/amazon/chroot/step_mount_extra.go b/builder/amazon/chroot/step_mount_extra.go index 7ebbb650a..ffd8ac027 100644 --- a/builder/amazon/chroot/step_mount_extra.go +++ b/builder/amazon/chroot/step_mount_extra.go @@ -2,15 +2,14 @@ package chroot import ( "bytes" + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "os" "os/exec" "syscall" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepMountExtra mounts the attached device. diff --git a/builder/amazon/chroot/step_post_mount_commands.go b/builder/amazon/chroot/step_post_mount_commands.go index 220e32a07..a00e8e1bf 100644 --- a/builder/amazon/chroot/step_post_mount_commands.go +++ b/builder/amazon/chroot/step_post_mount_commands.go @@ -1,6 +1,8 @@ package chroot import ( + "context" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/amazon/chroot/step_pre_mount_commands.go b/builder/amazon/chroot/step_pre_mount_commands.go index b3a8aae6b..ce3c26e02 100644 --- a/builder/amazon/chroot/step_pre_mount_commands.go +++ b/builder/amazon/chroot/step_pre_mount_commands.go @@ -1,6 +1,8 @@ package chroot import ( + "context" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/amazon/chroot/step_prepare_device.go b/builder/amazon/chroot/step_prepare_device.go index 4724457e5..0939d33cd 100644 --- a/builder/amazon/chroot/step_prepare_device.go +++ b/builder/amazon/chroot/step_prepare_device.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "fmt" "log" "os" diff --git a/builder/amazon/chroot/step_register_ami.go b/builder/amazon/chroot/step_register_ami.go index d73ea8b21..6fa9838b0 100644 --- a/builder/amazon/chroot/step_register_ami.go +++ b/builder/amazon/chroot/step_register_ami.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/chroot/step_snapshot.go b/builder/amazon/chroot/step_snapshot.go index 68a7bce2c..3fb3ff701 100644 --- a/builder/amazon/chroot/step_snapshot.go +++ b/builder/amazon/chroot/step_snapshot.go @@ -1,6 +1,7 @@ package chroot import ( + "context" "errors" "fmt" "time" diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index 9125453ea..a3d92b467 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "sync" diff --git a/builder/amazon/common/step_create_tags.go b/builder/amazon/common/step_create_tags.go index 903aea91a..47078b6ac 100644 --- a/builder/amazon/common/step_create_tags.go +++ b/builder/amazon/common/step_create_tags.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/common/step_deregister_ami.go b/builder/amazon/common/step_deregister_ami.go index 549987b6b..9c176d3c7 100644 --- a/builder/amazon/common/step_deregister_ami.go +++ b/builder/amazon/common/step_deregister_ami.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/common/step_encrypted_ami.go b/builder/amazon/common/step_encrypted_ami.go index 66174bea0..a07c0ee25 100644 --- a/builder/amazon/common/step_encrypted_ami.go +++ b/builder/amazon/common/step_encrypted_ami.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" diff --git a/builder/amazon/common/step_get_password.go b/builder/amazon/common/step_get_password.go index 28847003d..5e2a236c2 100644 --- a/builder/amazon/common/step_get_password.go +++ b/builder/amazon/common/step_get_password.go @@ -1,6 +1,7 @@ package common import ( + "context" "crypto/rsa" "crypto/x509" "encoding/base64" diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index 3558b1df2..927101fcf 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "os" diff --git a/builder/amazon/common/step_modify_ami_attributes.go b/builder/amazon/common/step_modify_ami_attributes.go index 7ba1deb6f..26ab31986 100644 --- a/builder/amazon/common/step_modify_ami_attributes.go +++ b/builder/amazon/common/step_modify_ami_attributes.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/common/step_modify_ebs_instance.go b/builder/amazon/common/step_modify_ebs_instance.go index 4145bc669..c2c454e06 100644 --- a/builder/amazon/common/step_modify_ebs_instance.go +++ b/builder/amazon/common/step_modify_ebs_instance.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/common/step_pre_validate.go b/builder/amazon/common/step_pre_validate.go index 57fca3fad..73b4022b7 100644 --- a/builder/amazon/common/step_pre_validate.go +++ b/builder/amazon/common/step_pre_validate.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/common/step_run_spot_instance.go b/builder/amazon/common/step_run_spot_instance.go index 6029ac617..c5e3382ec 100644 --- a/builder/amazon/common/step_run_spot_instance.go +++ b/builder/amazon/common/step_run_spot_instance.go @@ -1,6 +1,7 @@ package common import ( + "context" "encoding/base64" "fmt" "io/ioutil" diff --git a/builder/amazon/common/step_security_group.go b/builder/amazon/common/step_security_group.go index 3d3ff8f35..031842cd3 100644 --- a/builder/amazon/common/step_security_group.go +++ b/builder/amazon/common/step_security_group.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "time" diff --git a/builder/amazon/common/step_source_ami_info.go b/builder/amazon/common/step_source_ami_info.go index bc3b9dd17..5e57c2fbf 100644 --- a/builder/amazon/common/step_source_ami_info.go +++ b/builder/amazon/common/step_source_ami_info.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "sort" diff --git a/builder/amazon/common/step_stop_ebs_instance.go b/builder/amazon/common/step_stop_ebs_instance.go index efef99b8a..10a2f5a45 100644 --- a/builder/amazon/common/step_stop_ebs_instance.go +++ b/builder/amazon/common/step_stop_ebs_instance.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws/awserr" diff --git a/builder/amazon/ebs/step_cleanup_volumes.go b/builder/amazon/ebs/step_cleanup_volumes.go index 158f970e0..3fd0de64f 100644 --- a/builder/amazon/ebs/step_cleanup_volumes.go +++ b/builder/amazon/ebs/step_cleanup_volumes.go @@ -1,6 +1,7 @@ package ebs import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/ebs/step_create_ami.go b/builder/amazon/ebs/step_create_ami.go index 1ee7319bd..0dde4fc30 100644 --- a/builder/amazon/ebs/step_create_ami.go +++ b/builder/amazon/ebs/step_create_ami.go @@ -1,6 +1,7 @@ package ebs import ( + "context" "fmt" "github.com/aws/aws-sdk-go/service/ec2" diff --git a/builder/amazon/ebssurrogate/step_register_ami.go b/builder/amazon/ebssurrogate/step_register_ami.go index 28c01f52d..002ed00af 100644 --- a/builder/amazon/ebssurrogate/step_register_ami.go +++ b/builder/amazon/ebssurrogate/step_register_ami.go @@ -1,6 +1,7 @@ package ebssurrogate import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/ebssurrogate/step_snapshot_new_root.go b/builder/amazon/ebssurrogate/step_snapshot_new_root.go index 111f20268..3b607fbd0 100644 --- a/builder/amazon/ebssurrogate/step_snapshot_new_root.go +++ b/builder/amazon/ebssurrogate/step_snapshot_new_root.go @@ -1,6 +1,7 @@ package ebssurrogate import ( + "context" "errors" "fmt" "time" diff --git a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go index 42076dec2..a638ec439 100644 --- a/builder/amazon/ebsvolume/step_tag_ebs_volumes.go +++ b/builder/amazon/ebsvolume/step_tag_ebs_volumes.go @@ -1,6 +1,7 @@ package ebsvolume import ( + "context" "fmt" "github.com/aws/aws-sdk-go/service/ec2" diff --git a/builder/amazon/instance/step_bundle_volume.go b/builder/amazon/instance/step_bundle_volume.go index 61c2f5aad..1c8b006b8 100644 --- a/builder/amazon/instance/step_bundle_volume.go +++ b/builder/amazon/instance/step_bundle_volume.go @@ -1,6 +1,7 @@ package instance import ( + "context" "fmt" "github.com/aws/aws-sdk-go/service/ec2" diff --git a/builder/amazon/instance/step_register_ami.go b/builder/amazon/instance/step_register_ami.go index 9fb41d441..c46ff8ae4 100644 --- a/builder/amazon/instance/step_register_ami.go +++ b/builder/amazon/instance/step_register_ami.go @@ -1,6 +1,7 @@ package instance import ( + "context" "fmt" "github.com/aws/aws-sdk-go/aws" diff --git a/builder/amazon/instance/step_upload_bundle.go b/builder/amazon/instance/step_upload_bundle.go index 80ba9e88b..1e7711d42 100644 --- a/builder/amazon/instance/step_upload_bundle.go +++ b/builder/amazon/instance/step_upload_bundle.go @@ -1,6 +1,7 @@ package instance import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/amazon/instance/step_upload_x509_cert.go b/builder/amazon/instance/step_upload_x509_cert.go index 3853a53c1..14ea955e5 100644 --- a/builder/amazon/instance/step_upload_x509_cert.go +++ b/builder/amazon/instance/step_upload_x509_cert.go @@ -1,10 +1,12 @@ package instance import ( + "context" "fmt" + "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "os" ) type StepUploadX509Cert struct{} diff --git a/builder/azure/arm/step_capture_image.go b/builder/azure/arm/step_capture_image.go index 2da5bedc4..9e640a891 100644 --- a/builder/azure/arm/step_capture_image.go +++ b/builder/azure/arm/step_capture_image.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/Azure/azure-sdk-for-go/arm/compute" diff --git a/builder/azure/arm/step_create_resource_group.go b/builder/azure/arm/step_create_resource_group.go index 787aad132..e0535adf6 100644 --- a/builder/azure/arm/step_create_resource_group.go +++ b/builder/azure/arm/step_create_resource_group.go @@ -1,6 +1,7 @@ package arm import ( + "context" "errors" "fmt" diff --git a/builder/azure/arm/step_delete_os_disk.go b/builder/azure/arm/step_delete_os_disk.go index 92e9f9757..723c87db0 100644 --- a/builder/azure/arm/step_delete_os_disk.go +++ b/builder/azure/arm/step_delete_os_disk.go @@ -1,6 +1,7 @@ package arm import ( + "context" "errors" "fmt" "net/url" diff --git a/builder/azure/arm/step_delete_resource_group.go b/builder/azure/arm/step_delete_resource_group.go index a3bc2073b..a16ebf8f2 100644 --- a/builder/azure/arm/step_delete_resource_group.go +++ b/builder/azure/arm/step_delete_resource_group.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/Azure/go-autorest/autorest" diff --git a/builder/azure/arm/step_deploy_template.go b/builder/azure/arm/step_deploy_template.go index 06baddb24..af838c301 100644 --- a/builder/azure/arm/step_deploy_template.go +++ b/builder/azure/arm/step_deploy_template.go @@ -1,6 +1,7 @@ package arm import ( + "context" "errors" "fmt" "net/url" diff --git a/builder/azure/arm/step_get_certificate.go b/builder/azure/arm/step_get_certificate.go index df347e468..784826771 100644 --- a/builder/azure/arm/step_get_certificate.go +++ b/builder/azure/arm/step_get_certificate.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "time" diff --git a/builder/azure/arm/step_get_ip_address.go b/builder/azure/arm/step_get_ip_address.go index f6ef7dc1b..ee28f3054 100644 --- a/builder/azure/arm/step_get_ip_address.go +++ b/builder/azure/arm/step_get_ip_address.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/hashicorp/packer/builder/azure/common/constants" diff --git a/builder/azure/arm/step_get_os_disk.go b/builder/azure/arm/step_get_os_disk.go index 706f37a54..5e32e0eea 100644 --- a/builder/azure/arm/step_get_os_disk.go +++ b/builder/azure/arm/step_get_os_disk.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/Azure/azure-sdk-for-go/arm/compute" diff --git a/builder/azure/arm/step_power_off_compute.go b/builder/azure/arm/step_power_off_compute.go index e44b13c97..693348325 100644 --- a/builder/azure/arm/step_power_off_compute.go +++ b/builder/azure/arm/step_power_off_compute.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/hashicorp/packer/builder/azure/common" diff --git a/builder/azure/arm/step_set_certificate.go b/builder/azure/arm/step_set_certificate.go index 4729af0c0..ef8832074 100644 --- a/builder/azure/arm/step_set_certificate.go +++ b/builder/azure/arm/step_set_certificate.go @@ -1,6 +1,8 @@ package arm import ( + "context" + "github.com/hashicorp/packer/builder/azure/common/constants" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" diff --git a/builder/azure/arm/step_test.go b/builder/azure/arm/step_test.go index c0115b003..aa46455e0 100644 --- a/builder/azure/arm/step_test.go +++ b/builder/azure/arm/step_test.go @@ -7,7 +7,6 @@ import ( "github.com/hashicorp/packer/builder/azure/common" "github.com/hashicorp/packer/builder/azure/common/constants" "github.com/hashicorp/packer/helper/multistep" - "testing" ) func TestProcessStepResultShouldContinueForNonErrors(t *testing.T) { diff --git a/builder/azure/arm/step_validate_template.go b/builder/azure/arm/step_validate_template.go index bdf92e652..92927de5a 100644 --- a/builder/azure/arm/step_validate_template.go +++ b/builder/azure/arm/step_validate_template.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "github.com/hashicorp/packer/builder/azure/common/constants" diff --git a/builder/azure/common/lin/step_create_cert.go b/builder/azure/common/lin/step_create_cert.go index 66dda1a3c..da2cb5bf5 100644 --- a/builder/azure/common/lin/step_create_cert.go +++ b/builder/azure/common/lin/step_create_cert.go @@ -1,6 +1,7 @@ package lin import ( + "context" "crypto/rand" "crypto/rsa" "crypto/sha1" diff --git a/builder/azure/common/lin/step_generalize_os.go b/builder/azure/common/lin/step_generalize_os.go index d7836d22c..cc62f4eec 100644 --- a/builder/azure/common/lin/step_generalize_os.go +++ b/builder/azure/common/lin/step_generalize_os.go @@ -2,10 +2,12 @@ package lin import ( "bytes" + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) type StepGeneralizeOS struct { diff --git a/builder/cloudstack/step_configure_networking.go b/builder/cloudstack/step_configure_networking.go index 1e2e322b0..ff37a540a 100644 --- a/builder/cloudstack/step_configure_networking.go +++ b/builder/cloudstack/step_configure_networking.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "math/rand" "strings" diff --git a/builder/cloudstack/step_create_instance.go b/builder/cloudstack/step_create_instance.go index 1ca0a4f70..19f6a3c28 100644 --- a/builder/cloudstack/step_create_instance.go +++ b/builder/cloudstack/step_create_instance.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "encoding/base64" "errors" "fmt" diff --git a/builder/cloudstack/step_create_security_group.go b/builder/cloudstack/step_create_security_group.go index fb5f24a4a..c42eec5d5 100644 --- a/builder/cloudstack/step_create_security_group.go +++ b/builder/cloudstack/step_create_security_group.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "github.com/hashicorp/packer/common/uuid" diff --git a/builder/cloudstack/step_create_template.go b/builder/cloudstack/step_create_template.go index 928e231d1..4afba8699 100644 --- a/builder/cloudstack/step_create_template.go +++ b/builder/cloudstack/step_create_template.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "time" diff --git a/builder/cloudstack/step_keypair.go b/builder/cloudstack/step_keypair.go index 7334da372..e1f002b76 100644 --- a/builder/cloudstack/step_keypair.go +++ b/builder/cloudstack/step_keypair.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "io/ioutil" "os" diff --git a/builder/cloudstack/step_prepare_config.go b/builder/cloudstack/step_prepare_config.go index 3c2944c7d..644547018 100644 --- a/builder/cloudstack/step_prepare_config.go +++ b/builder/cloudstack/step_prepare_config.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "io/ioutil" "regexp" diff --git a/builder/cloudstack/step_shutdown_instance.go b/builder/cloudstack/step_shutdown_instance.go index 10a4acbdd..a7f07e8b2 100644 --- a/builder/cloudstack/step_shutdown_instance.go +++ b/builder/cloudstack/step_shutdown_instance.go @@ -1,6 +1,7 @@ package cloudstack import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/docker/step_commit.go b/builder/docker/step_commit.go index d32f5f888..d248ee64c 100644 --- a/builder/docker/step_commit.go +++ b/builder/docker/step_commit.go @@ -1,7 +1,9 @@ package docker import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/docker/step_commit_test.go b/builder/docker/step_commit_test.go index b828aa3e2..ff2db0ad7 100644 --- a/builder/docker/step_commit_test.go +++ b/builder/docker/step_commit_test.go @@ -2,10 +2,9 @@ package docker import ( "errors" - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testStepCommitState(t *testing.T) multistep.StateBag { diff --git a/builder/docker/step_connect_docker.go b/builder/docker/step_connect_docker.go index 2e3a3270a..ef0222a91 100644 --- a/builder/docker/step_connect_docker.go +++ b/builder/docker/step_connect_docker.go @@ -1,12 +1,12 @@ package docker import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" "os/exec" "strings" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) type StepConnectDocker struct{} diff --git a/builder/docker/step_export.go b/builder/docker/step_export.go index b11319f81..138e0f00c 100644 --- a/builder/docker/step_export.go +++ b/builder/docker/step_export.go @@ -1,6 +1,7 @@ package docker import ( + "context" "fmt" "os" "path/filepath" diff --git a/builder/docker/step_export_test.go b/builder/docker/step_export_test.go index 622d0ee5a..1b1221e62 100644 --- a/builder/docker/step_export_test.go +++ b/builder/docker/step_export_test.go @@ -3,12 +3,11 @@ package docker import ( "bytes" "errors" - "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testStepExportState(t *testing.T) multistep.StateBag { diff --git a/builder/docker/step_pull.go b/builder/docker/step_pull.go index 946029943..fd011680e 100644 --- a/builder/docker/step_pull.go +++ b/builder/docker/step_pull.go @@ -1,6 +1,7 @@ package docker import ( + "context" "fmt" "log" diff --git a/builder/docker/step_pull_test.go b/builder/docker/step_pull_test.go index 6bd3d5e84..9b8ed1d1b 100644 --- a/builder/docker/step_pull_test.go +++ b/builder/docker/step_pull_test.go @@ -2,10 +2,9 @@ package docker import ( "errors" - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepPull_impl(t *testing.T) { diff --git a/builder/docker/step_run.go b/builder/docker/step_run.go index c5b8fc525..1d2ba6862 100644 --- a/builder/docker/step_run.go +++ b/builder/docker/step_run.go @@ -1,7 +1,9 @@ package docker import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/docker/step_run_test.go b/builder/docker/step_run_test.go index 66bd02baf..9993cb357 100644 --- a/builder/docker/step_run_test.go +++ b/builder/docker/step_run_test.go @@ -1,11 +1,11 @@ package docker import ( + "context" "errors" - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testStepRunState(t *testing.T) multistep.StateBag { diff --git a/builder/docker/step_temp_dir.go b/builder/docker/step_temp_dir.go index d3c1502ff..a5b1d6ade 100644 --- a/builder/docker/step_temp_dir.go +++ b/builder/docker/step_temp_dir.go @@ -1,14 +1,13 @@ package docker import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "io/ioutil" "os" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepTempDir creates a temporary directory that we use in order to diff --git a/builder/docker/step_test.go b/builder/docker/step_test.go index fa0702612..0c7d56649 100644 --- a/builder/docker/step_test.go +++ b/builder/docker/step_test.go @@ -2,9 +2,10 @@ package docker import ( "bytes" + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/googlecompute/step_check_existing_image.go b/builder/googlecompute/step_check_existing_image.go index 92a79f3fa..ac11600e1 100644 --- a/builder/googlecompute/step_check_existing_image.go +++ b/builder/googlecompute/step_check_existing_image.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/googlecompute/step_check_existing_image_test.go b/builder/googlecompute/step_check_existing_image_test.go index 36f9e110a..1c499e743 100644 --- a/builder/googlecompute/step_check_existing_image_test.go +++ b/builder/googlecompute/step_check_existing_image_test.go @@ -1,10 +1,9 @@ package googlecompute import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepCheckExistingImage_impl(t *testing.T) { diff --git a/builder/googlecompute/step_create_image.go b/builder/googlecompute/step_create_image.go index 16434f6c7..72e6a06eb 100644 --- a/builder/googlecompute/step_create_image.go +++ b/builder/googlecompute/step_create_image.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "fmt" "time" diff --git a/builder/googlecompute/step_create_instance.go b/builder/googlecompute/step_create_instance.go index 1a713f123..ee3b6643b 100644 --- a/builder/googlecompute/step_create_instance.go +++ b/builder/googlecompute/step_create_instance.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "fmt" "io/ioutil" diff --git a/builder/googlecompute/step_create_ssh_key.go b/builder/googlecompute/step_create_ssh_key.go index f121e3dae..7d5a24555 100644 --- a/builder/googlecompute/step_create_ssh_key.go +++ b/builder/googlecompute/step_create_ssh_key.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "crypto/rand" "crypto/rsa" "crypto/x509" diff --git a/builder/googlecompute/step_create_windows_password.go b/builder/googlecompute/step_create_windows_password.go index b7d09e10d..3386f6fbc 100644 --- a/builder/googlecompute/step_create_windows_password.go +++ b/builder/googlecompute/step_create_windows_password.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "crypto/rand" "crypto/rsa" "crypto/x509" diff --git a/builder/googlecompute/step_instance_info.go b/builder/googlecompute/step_instance_info.go index 5604b3e9b..d67984b75 100644 --- a/builder/googlecompute/step_instance_info.go +++ b/builder/googlecompute/step_instance_info.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "fmt" "time" diff --git a/builder/googlecompute/step_instance_info_test.go b/builder/googlecompute/step_instance_info_test.go index 8ced83c5d..3918a009e 100644 --- a/builder/googlecompute/step_instance_info_test.go +++ b/builder/googlecompute/step_instance_info_test.go @@ -2,11 +2,10 @@ package googlecompute import ( "errors" - "github.com/hashicorp/packer/helper/multistep" "testing" "time" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepInstanceInfo_impl(t *testing.T) { diff --git a/builder/googlecompute/step_teardown_instance.go b/builder/googlecompute/step_teardown_instance.go index e40e2fc7b..27f9fee35 100644 --- a/builder/googlecompute/step_teardown_instance.go +++ b/builder/googlecompute/step_teardown_instance.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "fmt" "time" diff --git a/builder/googlecompute/step_teardown_instance_test.go b/builder/googlecompute/step_teardown_instance_test.go index 295230e01..f19dac960 100644 --- a/builder/googlecompute/step_teardown_instance_test.go +++ b/builder/googlecompute/step_teardown_instance_test.go @@ -1,10 +1,9 @@ package googlecompute import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepTeardownInstance_impl(t *testing.T) { diff --git a/builder/googlecompute/step_wait_startup_script.go b/builder/googlecompute/step_wait_startup_script.go index 9770d7cb3..efc2a78f7 100644 --- a/builder/googlecompute/step_wait_startup_script.go +++ b/builder/googlecompute/step_wait_startup_script.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "fmt" diff --git a/builder/googlecompute/step_wait_startup_script_test.go b/builder/googlecompute/step_wait_startup_script_test.go index a48176a61..51643eb2d 100644 --- a/builder/googlecompute/step_wait_startup_script_test.go +++ b/builder/googlecompute/step_wait_startup_script_test.go @@ -1,6 +1,8 @@ package googlecompute import ( + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/stretchr/testify/assert" ) diff --git a/builder/hyperv/common/step_clone_vm.go b/builder/hyperv/common/step_clone_vm.go index cda0c5da5..f6dc9e390 100644 --- a/builder/hyperv/common/step_clone_vm.go +++ b/builder/hyperv/common/step_clone_vm.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "path/filepath" diff --git a/builder/hyperv/common/step_configure_ip.go b/builder/hyperv/common/step_configure_ip.go index d9ca74344..41d945a0d 100644 --- a/builder/hyperv/common/step_configure_ip.go +++ b/builder/hyperv/common/step_configure_ip.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "strings" diff --git a/builder/hyperv/common/step_configure_vlan.go b/builder/hyperv/common/step_configure_vlan.go index ea26af22e..a167b9ed1 100644 --- a/builder/hyperv/common/step_configure_vlan.go +++ b/builder/hyperv/common/step_configure_vlan.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/hyperv/common/step_create_external_switch.go b/builder/hyperv/common/step_create_external_switch.go index 1e0ea6976..56e6fa6e8 100644 --- a/builder/hyperv/common/step_create_external_switch.go +++ b/builder/hyperv/common/step_create_external_switch.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/hashicorp/packer/common/uuid" diff --git a/builder/hyperv/common/step_create_switch.go b/builder/hyperv/common/step_create_switch.go index 0b1df3342..4b5ef48e2 100644 --- a/builder/hyperv/common/step_create_switch.go +++ b/builder/hyperv/common/step_create_switch.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_create_tempdir.go b/builder/hyperv/common/step_create_tempdir.go index a9829608c..1a9767fe5 100644 --- a/builder/hyperv/common/step_create_tempdir.go +++ b/builder/hyperv/common/step_create_tempdir.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "os" diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index 1e28889c7..291fdc5dc 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "path/filepath" diff --git a/builder/hyperv/common/step_disable_vlan.go b/builder/hyperv/common/step_disable_vlan.go index acd0d323d..0d4882ec1 100644 --- a/builder/hyperv/common/step_disable_vlan.go +++ b/builder/hyperv/common/step_disable_vlan.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_enable_integration_service.go b/builder/hyperv/common/step_enable_integration_service.go index ddb74c41d..e3f8fd70a 100644 --- a/builder/hyperv/common/step_enable_integration_service.go +++ b/builder/hyperv/common/step_enable_integration_service.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_export_vm.go b/builder/hyperv/common/step_export_vm.go index f5ff4cf93..6de5dbb70 100644 --- a/builder/hyperv/common/step_export_vm.go +++ b/builder/hyperv/common/step_export_vm.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "path/filepath" diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index 8957fe6c2..945c6a86d 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -1,15 +1,14 @@ package common import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepMountDvdDrive struct { diff --git a/builder/hyperv/common/step_mount_floppydrive.go b/builder/hyperv/common/step_mount_floppydrive.go index ecf9b0194..1ae03d1db 100644 --- a/builder/hyperv/common/step_mount_floppydrive.go +++ b/builder/hyperv/common/step_mount_floppydrive.go @@ -1,17 +1,16 @@ package common import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "io" "io/ioutil" "log" "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const ( diff --git a/builder/hyperv/common/step_mount_guest_additions.go b/builder/hyperv/common/step_mount_guest_additions.go index f20e070d3..71b6c3eec 100644 --- a/builder/hyperv/common/step_mount_guest_additions.go +++ b/builder/hyperv/common/step_mount_guest_additions.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) type StepMountGuestAdditions struct { diff --git a/builder/hyperv/common/step_mount_secondary_dvd_images.go b/builder/hyperv/common/step_mount_secondary_dvd_images.go index 9b29a84a0..c23e39fac 100644 --- a/builder/hyperv/common/step_mount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_mount_secondary_dvd_images.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) type StepMountSecondaryDvdImages struct { diff --git a/builder/hyperv/common/step_output_dir.go b/builder/hyperv/common/step_output_dir.go index cad96b98e..fc39d08b2 100644 --- a/builder/hyperv/common/step_output_dir.go +++ b/builder/hyperv/common/step_output_dir.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" diff --git a/builder/hyperv/common/step_polling_installation.go b/builder/hyperv/common/step_polling_installation.go index 092c01b17..b9d2984f6 100644 --- a/builder/hyperv/common/step_polling_installation.go +++ b/builder/hyperv/common/step_polling_installation.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "fmt" "log" "os/exec" diff --git a/builder/hyperv/common/step_reboot_vm.go b/builder/hyperv/common/step_reboot_vm.go index 850c6aac9..8e2bec1b8 100644 --- a/builder/hyperv/common/step_reboot_vm.go +++ b/builder/hyperv/common/step_reboot_vm.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) type StepRebootVm struct { diff --git a/builder/hyperv/common/step_run.go b/builder/hyperv/common/step_run.go index ead739667..cd8213c5e 100644 --- a/builder/hyperv/common/step_run.go +++ b/builder/hyperv/common/step_run.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) type StepRun struct { diff --git a/builder/hyperv/common/step_shutdown.go b/builder/hyperv/common/step_shutdown.go index ddced9619..b37716f60 100644 --- a/builder/hyperv/common/step_shutdown.go +++ b/builder/hyperv/common/step_shutdown.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "errors" "fmt" "log" diff --git a/builder/hyperv/common/step_sleep.go b/builder/hyperv/common/step_sleep.go index fbf671cdf..e65bcf0b1 100644 --- a/builder/hyperv/common/step_sleep.go +++ b/builder/hyperv/common/step_sleep.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) type StepSleep struct { diff --git a/builder/hyperv/common/step_type_boot_command.go b/builder/hyperv/common/step_type_boot_command.go index 515c30907..43deee1fd 100644 --- a/builder/hyperv/common/step_type_boot_command.go +++ b/builder/hyperv/common/step_type_boot_command.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "strings" diff --git a/builder/hyperv/common/step_unmount_dvddrive.go b/builder/hyperv/common/step_unmount_dvddrive.go index cb62bc131..010e8b067 100644 --- a/builder/hyperv/common/step_unmount_dvddrive.go +++ b/builder/hyperv/common/step_unmount_dvddrive.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_unmount_floppydrive.go b/builder/hyperv/common/step_unmount_floppydrive.go index 07dff3b70..34f09aaa0 100644 --- a/builder/hyperv/common/step_unmount_floppydrive.go +++ b/builder/hyperv/common/step_unmount_floppydrive.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_unmount_guest_additions.go b/builder/hyperv/common/step_unmount_guest_additions.go index 112c9c825..06600ddaa 100644 --- a/builder/hyperv/common/step_unmount_guest_additions.go +++ b/builder/hyperv/common/step_unmount_guest_additions.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_unmount_secondary_dvd_images.go b/builder/hyperv/common/step_unmount_secondary_dvd_images.go index 3de0f7ac6..0f74d2789 100644 --- a/builder/hyperv/common/step_unmount_secondary_dvd_images.go +++ b/builder/hyperv/common/step_unmount_secondary_dvd_images.go @@ -1,7 +1,9 @@ package common import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/builder/hyperv/common/step_wait_for_install_to_complete.go b/builder/hyperv/common/step_wait_for_install_to_complete.go index ee7d11beb..0a40730b3 100644 --- a/builder/hyperv/common/step_wait_for_install_to_complete.go +++ b/builder/hyperv/common/step_wait_for_install_to_complete.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) const ( diff --git a/builder/hyperv/iso/builder_test.go b/builder/hyperv/iso/builder_test.go index 74c8de44e..fa164d85f 100644 --- a/builder/hyperv/iso/builder_test.go +++ b/builder/hyperv/iso/builder_test.go @@ -11,7 +11,6 @@ import ( hypervcommon "github.com/hashicorp/packer/builder/hyperv/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "os" ) func testConfig() map[string]interface{} { diff --git a/builder/hyperv/vmcx/builder_test.go b/builder/hyperv/vmcx/builder_test.go index 7792a365c..e428672c6 100644 --- a/builder/hyperv/vmcx/builder_test.go +++ b/builder/hyperv/vmcx/builder_test.go @@ -11,8 +11,6 @@ import ( hypervcommon "github.com/hashicorp/packer/builder/hyperv/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "io/ioutil" - "os" ) func testConfig() map[string]interface{} { diff --git a/builder/lxc/builder.go b/builder/lxc/builder.go index 82683b890..8c239cd9b 100644 --- a/builder/lxc/builder.go +++ b/builder/lxc/builder.go @@ -9,9 +9,6 @@ import ( "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "log" - "os" - "path/filepath" ) // The unique ID for this builder diff --git a/builder/lxc/step_export.go b/builder/lxc/step_export.go index 2bafdeb41..f01b30074 100644 --- a/builder/lxc/step_export.go +++ b/builder/lxc/step_export.go @@ -2,9 +2,8 @@ package lxc import ( "bytes" + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "io" "log" "os" @@ -12,8 +11,8 @@ import ( "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepExport struct{} diff --git a/builder/lxc/step_lxc_create.go b/builder/lxc/step_lxc_create.go index 9efb7bc87..98dce3a7c 100644 --- a/builder/lxc/step_lxc_create.go +++ b/builder/lxc/step_lxc_create.go @@ -2,16 +2,15 @@ package lxc import ( "bytes" + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "os/exec" "path/filepath" "strings" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepLxcCreate struct{} diff --git a/builder/lxc/step_prepare_output_dir.go b/builder/lxc/step_prepare_output_dir.go index 1dd082580..25479fd8a 100644 --- a/builder/lxc/step_prepare_output_dir.go +++ b/builder/lxc/step_prepare_output_dir.go @@ -1,14 +1,13 @@ package lxc import ( - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" + "context" "log" "os" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepPrepareOutputDir struct{} diff --git a/builder/lxc/step_provision.go b/builder/lxc/step_provision.go index 937435d85..ac33eb301 100644 --- a/builder/lxc/step_provision.go +++ b/builder/lxc/step_provision.go @@ -1,9 +1,11 @@ package lxc import ( + "context" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // StepProvision provisions the instance within a chroot. diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index 19383fb62..4e055a690 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -1,16 +1,15 @@ package lxc import ( + "context" "errors" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type StepWaitInit struct { diff --git a/builder/lxd/builder.go b/builder/lxd/builder.go index d1b040853..290b8a631 100644 --- a/builder/lxd/builder.go +++ b/builder/lxd/builder.go @@ -7,7 +7,6 @@ import ( "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" - "log" ) // The unique ID for this builder diff --git a/builder/lxd/step_lxd_launch.go b/builder/lxd/step_lxd_launch.go index f1a6f6b45..de34a5cb4 100644 --- a/builder/lxd/step_lxd_launch.go +++ b/builder/lxd/step_lxd_launch.go @@ -1,10 +1,12 @@ package lxd import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) type stepLxdLaunch struct{} diff --git a/builder/lxd/step_provision.go b/builder/lxd/step_provision.go index dedd1a2ae..509006d77 100644 --- a/builder/lxd/step_provision.go +++ b/builder/lxd/step_provision.go @@ -1,9 +1,11 @@ package lxd import ( + "context" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // StepProvision provisions the container diff --git a/builder/lxd/step_publish.go b/builder/lxd/step_publish.go index 4a6c206fe..4dc21880f 100644 --- a/builder/lxd/step_publish.go +++ b/builder/lxd/step_publish.go @@ -1,10 +1,12 @@ package lxd import ( + "context" "fmt" + "regexp" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "regexp" ) type stepPublish struct{} diff --git a/builder/oneandone/builder.go b/builder/oneandone/builder.go index 7b7be84aa..4b84b3938 100644 --- a/builder/oneandone/builder.go +++ b/builder/oneandone/builder.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) const BuilderId = "packer.oneandone" diff --git a/builder/oneandone/step_create_server.go b/builder/oneandone/step_create_server.go index 8aa05fb48..cffd8c440 100644 --- a/builder/oneandone/step_create_server.go +++ b/builder/oneandone/step_create_server.go @@ -1,6 +1,7 @@ package oneandone import ( + "context" "fmt" "strings" "time" @@ -8,8 +9,6 @@ import ( "github.com/1and1/oneandone-cloudserver-sdk-go" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "strings" - "time" ) type stepCreateServer struct{} diff --git a/builder/oneandone/step_create_sshkey.go b/builder/oneandone/step_create_sshkey.go index 9a1a58528..a27561c1f 100644 --- a/builder/oneandone/step_create_sshkey.go +++ b/builder/oneandone/step_create_sshkey.go @@ -1,9 +1,12 @@ package oneandone import ( + "context" "crypto/x509" "encoding/pem" "fmt" + "io/ioutil" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "golang.org/x/crypto/ssh" diff --git a/builder/oneandone/step_take_snapshot.go b/builder/oneandone/step_take_snapshot.go index cedfb604a..65a3f7156 100644 --- a/builder/oneandone/step_take_snapshot.go +++ b/builder/oneandone/step_take_snapshot.go @@ -1,6 +1,8 @@ package oneandone import ( + "context" + "github.com/1and1/oneandone-cloudserver-sdk-go" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" diff --git a/builder/openstack/step_add_image_members.go b/builder/openstack/step_add_image_members.go index eda4122ce..e23e54588 100644 --- a/builder/openstack/step_add_image_members.go +++ b/builder/openstack/step_add_image_members.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "github.com/gophercloud/gophercloud/openstack/imageservice/v2/members" diff --git a/builder/openstack/step_allocate_ip.go b/builder/openstack/step_allocate_ip.go index 15f214d17..fb53ce434 100644 --- a/builder/openstack/step_allocate_ip.go +++ b/builder/openstack/step_allocate_ip.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips" diff --git a/builder/openstack/step_create_image.go b/builder/openstack/step_create_image.go index 777a3cb6a..de8a6f4f6 100644 --- a/builder/openstack/step_create_image.go +++ b/builder/openstack/step_create_image.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "log" "time" diff --git a/builder/openstack/step_get_password.go b/builder/openstack/step_get_password.go index 95f52e194..4b962db4b 100644 --- a/builder/openstack/step_get_password.go +++ b/builder/openstack/step_get_password.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "crypto/rsa" "fmt" "log" diff --git a/builder/openstack/step_key_pair.go b/builder/openstack/step_key_pair.go index fb46c1392..c4eba5804 100644 --- a/builder/openstack/step_key_pair.go +++ b/builder/openstack/step_key_pair.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "io/ioutil" "log" diff --git a/builder/openstack/step_load_extensions.go b/builder/openstack/step_load_extensions.go index a5ffe8145..b11cf5527 100644 --- a/builder/openstack/step_load_extensions.go +++ b/builder/openstack/step_load_extensions.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "log" diff --git a/builder/openstack/step_load_flavor.go b/builder/openstack/step_load_flavor.go index 00f1b7092..8c331aa6a 100644 --- a/builder/openstack/step_load_flavor.go +++ b/builder/openstack/step_load_flavor.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "log" diff --git a/builder/openstack/step_run_source_server.go b/builder/openstack/step_run_source_server.go index ebbc45773..bb09f85b7 100644 --- a/builder/openstack/step_run_source_server.go +++ b/builder/openstack/step_run_source_server.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "io/ioutil" "log" diff --git a/builder/openstack/step_stop_server.go b/builder/openstack/step_stop_server.go index bc651b7ce..1c864eef0 100644 --- a/builder/openstack/step_stop_server.go +++ b/builder/openstack/step_stop_server.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/startstop" diff --git a/builder/openstack/step_update_image_visibility.go b/builder/openstack/step_update_image_visibility.go index bd814638b..8d9a3bc7c 100644 --- a/builder/openstack/step_update_image_visibility.go +++ b/builder/openstack/step_update_image_visibility.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" imageservice "github.com/gophercloud/gophercloud/openstack/imageservice/v2/images" diff --git a/builder/openstack/step_wait_for_rackconnect.go b/builder/openstack/step_wait_for_rackconnect.go index f214e0894..6cbe2ed0e 100644 --- a/builder/openstack/step_wait_for_rackconnect.go +++ b/builder/openstack/step_wait_for_rackconnect.go @@ -1,6 +1,7 @@ package openstack import ( + "context" "fmt" "time" diff --git a/builder/oracle/oci/step_create_instance.go b/builder/oracle/oci/step_create_instance.go index cb1ce6642..375b92b1b 100644 --- a/builder/oracle/oci/step_create_instance.go +++ b/builder/oracle/oci/step_create_instance.go @@ -1,6 +1,7 @@ package oci import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/oracle/oci/step_image.go b/builder/oracle/oci/step_image.go index 46c7ed8ba..ff767f709 100644 --- a/builder/oracle/oci/step_image.go +++ b/builder/oracle/oci/step_image.go @@ -1,6 +1,7 @@ package oci import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/oracle/oci/step_instance_info.go b/builder/oracle/oci/step_instance_info.go index 9b79529cc..d3e024978 100644 --- a/builder/oracle/oci/step_instance_info.go +++ b/builder/oracle/oci/step_instance_info.go @@ -1,6 +1,7 @@ package oci import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/oracle/oci/step_ssh_key_pair.go b/builder/oracle/oci/step_ssh_key_pair.go index c9e80e54b..9fa83c17d 100644 --- a/builder/oracle/oci/step_ssh_key_pair.go +++ b/builder/oracle/oci/step_ssh_key_pair.go @@ -1,6 +1,7 @@ package oci import ( + "context" "crypto/rand" "crypto/rsa" "crypto/x509" diff --git a/builder/parallels/common/step_attach_floppy.go b/builder/parallels/common/step_attach_floppy.go index bd8116597..fa9566011 100644 --- a/builder/parallels/common/step_attach_floppy.go +++ b/builder/parallels/common/step_attach_floppy.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" diff --git a/builder/parallels/common/step_attach_parallels_tools.go b/builder/parallels/common/step_attach_parallels_tools.go index 645cec0d7..1c1ea31b4 100644 --- a/builder/parallels/common/step_attach_parallels_tools.go +++ b/builder/parallels/common/step_attach_parallels_tools.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" diff --git a/builder/parallels/common/step_compact_disk.go b/builder/parallels/common/step_compact_disk.go index 90f05b7f9..85688de51 100644 --- a/builder/parallels/common/step_compact_disk.go +++ b/builder/parallels/common/step_compact_disk.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/parallels/common/step_output_dir.go b/builder/parallels/common/step_output_dir.go index c94ab3928..f6f092c4a 100644 --- a/builder/parallels/common/step_output_dir.go +++ b/builder/parallels/common/step_output_dir.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" diff --git a/builder/parallels/common/step_prepare_parallels_tools.go b/builder/parallels/common/step_prepare_parallels_tools.go index c64fd395b..5da892782 100644 --- a/builder/parallels/common/step_prepare_parallels_tools.go +++ b/builder/parallels/common/step_prepare_parallels_tools.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "os" diff --git a/builder/parallels/common/step_prlctl.go b/builder/parallels/common/step_prlctl.go index eea179a70..9ae6ec7e9 100644 --- a/builder/parallels/common/step_prlctl.go +++ b/builder/parallels/common/step_prlctl.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "strings" diff --git a/builder/parallels/common/step_run.go b/builder/parallels/common/step_run.go index b37e536d5..073ad0550 100644 --- a/builder/parallels/common/step_run.go +++ b/builder/parallels/common/step_run.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "time" diff --git a/builder/parallels/common/step_shutdown.go b/builder/parallels/common/step_shutdown.go index 10a4c5a3f..7f9d3b663 100644 --- a/builder/parallels/common/step_shutdown.go +++ b/builder/parallels/common/step_shutdown.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "errors" "fmt" "log" diff --git a/builder/parallels/common/step_type_boot_command.go b/builder/parallels/common/step_type_boot_command.go index bd6adbfd8..e39a90b6c 100644 --- a/builder/parallels/common/step_type_boot_command.go +++ b/builder/parallels/common/step_type_boot_command.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "strings" diff --git a/builder/parallels/common/step_upload_parallels_tools.go b/builder/parallels/common/step_upload_parallels_tools.go index 86bd5171b..0da0b26e0 100644 --- a/builder/parallels/common/step_upload_parallels_tools.go +++ b/builder/parallels/common/step_upload_parallels_tools.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" diff --git a/builder/parallels/common/step_upload_version.go b/builder/parallels/common/step_upload_version.go index 982f38f9f..1a1bfcf0c 100644 --- a/builder/parallels/common/step_upload_version.go +++ b/builder/parallels/common/step_upload_version.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "fmt" "log" diff --git a/builder/parallels/iso/step_attach_iso.go b/builder/parallels/iso/step_attach_iso.go index bfb7bacf9..a4cf634a8 100644 --- a/builder/parallels/iso/step_attach_iso.go +++ b/builder/parallels/iso/step_attach_iso.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" "log" diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index d98f8c5b4..42640f5a8 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" "strconv" diff --git a/builder/parallels/iso/step_create_vm.go b/builder/parallels/iso/step_create_vm.go index 255bafaaa..8a4e22517 100644 --- a/builder/parallels/iso/step_create_vm.go +++ b/builder/parallels/iso/step_create_vm.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" diff --git a/builder/parallels/iso/step_set_boot_order.go b/builder/parallels/iso/step_set_boot_order.go index 5b44d98af..cfcda6080 100644 --- a/builder/parallels/iso/step_set_boot_order.go +++ b/builder/parallels/iso/step_set_boot_order.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" diff --git a/builder/parallels/pvm/step_import.go b/builder/parallels/pvm/step_import.go index c8b97dd54..0907c6b44 100644 --- a/builder/parallels/pvm/step_import.go +++ b/builder/parallels/pvm/step_import.go @@ -1,6 +1,7 @@ package pvm import ( + "context" "fmt" parallelscommon "github.com/hashicorp/packer/builder/parallels/common" diff --git a/builder/profitbricks/builder.go b/builder/profitbricks/builder.go index fc7734a07..6a1428075 100644 --- a/builder/profitbricks/builder.go +++ b/builder/profitbricks/builder.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) const BuilderId = "packer.profitbricks" diff --git a/builder/profitbricks/step_create_server.go b/builder/profitbricks/step_create_server.go index 926864118..00742762a 100644 --- a/builder/profitbricks/step_create_server.go +++ b/builder/profitbricks/step_create_server.go @@ -1,6 +1,7 @@ package profitbricks import ( + "context" "encoding/json" "errors" "fmt" diff --git a/builder/profitbricks/step_create_ssh_key.go b/builder/profitbricks/step_create_ssh_key.go index 4c1a75d18..be0b973a8 100644 --- a/builder/profitbricks/step_create_ssh_key.go +++ b/builder/profitbricks/step_create_ssh_key.go @@ -1,9 +1,12 @@ package profitbricks import ( + "context" "crypto/x509" "encoding/pem" "fmt" + "io/ioutil" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" "golang.org/x/crypto/ssh" diff --git a/builder/profitbricks/step_take_snapshot.go b/builder/profitbricks/step_take_snapshot.go index 8cbc208b8..a3bfe2d7d 100644 --- a/builder/profitbricks/step_take_snapshot.go +++ b/builder/profitbricks/step_take_snapshot.go @@ -1,6 +1,7 @@ package profitbricks import ( + "context" "encoding/json" "time" diff --git a/builder/qemu/step_boot_wait.go b/builder/qemu/step_boot_wait.go index fe7025b84..0c3935004 100644 --- a/builder/qemu/step_boot_wait.go +++ b/builder/qemu/step_boot_wait.go @@ -1,10 +1,12 @@ package qemu import ( + "context" "fmt" + "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "time" ) // stepBootWait waits the configured time period. diff --git a/builder/qemu/step_configure_vnc.go b/builder/qemu/step_configure_vnc.go index 5d412b811..1f1cd088d 100644 --- a/builder/qemu/step_configure_vnc.go +++ b/builder/qemu/step_configure_vnc.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "log" "math/rand" diff --git a/builder/qemu/step_convert_disk.go b/builder/qemu/step_convert_disk.go index 209361f5d..bc5c3f3b1 100644 --- a/builder/qemu/step_convert_disk.go +++ b/builder/qemu/step_convert_disk.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "path/filepath" diff --git a/builder/qemu/step_copy_disk.go b/builder/qemu/step_copy_disk.go index a6a2e8ca1..51ca47a1d 100644 --- a/builder/qemu/step_copy_disk.go +++ b/builder/qemu/step_copy_disk.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "path/filepath" diff --git a/builder/qemu/step_create_disk.go b/builder/qemu/step_create_disk.go index 05b5d0833..4472903f1 100644 --- a/builder/qemu/step_create_disk.go +++ b/builder/qemu/step_create_disk.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "path/filepath" diff --git a/builder/qemu/step_forward_ssh.go b/builder/qemu/step_forward_ssh.go index 296c94d19..6e9efaca1 100644 --- a/builder/qemu/step_forward_ssh.go +++ b/builder/qemu/step_forward_ssh.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "log" "math/rand" diff --git a/builder/qemu/step_prepare_output_dir.go b/builder/qemu/step_prepare_output_dir.go index f24138c4c..8eeebb4e1 100644 --- a/builder/qemu/step_prepare_output_dir.go +++ b/builder/qemu/step_prepare_output_dir.go @@ -1,14 +1,13 @@ package qemu import ( - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" + "context" "log" "os" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) type stepPrepareOutputDir struct{} diff --git a/builder/qemu/step_resize_disk.go b/builder/qemu/step_resize_disk.go index 63b430187..8ffab5931 100644 --- a/builder/qemu/step_resize_disk.go +++ b/builder/qemu/step_resize_disk.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "path/filepath" diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index 463c8bf07..c524d5514 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "log" "path/filepath" diff --git a/builder/qemu/step_set_iso.go b/builder/qemu/step_set_iso.go index e17bbd254..dba34777f 100644 --- a/builder/qemu/step_set_iso.go +++ b/builder/qemu/step_set_iso.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "net/http" diff --git a/builder/qemu/step_shutdown.go b/builder/qemu/step_shutdown.go index 394fc16fa..9c5f89f6c 100644 --- a/builder/qemu/step_shutdown.go +++ b/builder/qemu/step_shutdown.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "errors" "fmt" "log" diff --git a/builder/qemu/step_type_boot_command.go b/builder/qemu/step_type_boot_command.go index dbc896a48..f1dc895e9 100644 --- a/builder/qemu/step_type_boot_command.go +++ b/builder/qemu/step_type_boot_command.go @@ -1,6 +1,7 @@ package qemu import ( + "context" "fmt" "log" "net" @@ -17,7 +18,6 @@ import ( "github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/template/interpolate" "github.com/mitchellh/go-vnc" - "os" ) const KeyLeftShift uint32 = 0xFFE1 diff --git a/builder/triton/step_create_image_from_machine.go b/builder/triton/step_create_image_from_machine.go index df83e5205..425a6690b 100644 --- a/builder/triton/step_create_image_from_machine.go +++ b/builder/triton/step_create_image_from_machine.go @@ -1,6 +1,7 @@ package triton import ( + "context" "fmt" "time" diff --git a/builder/triton/step_create_source_machine.go b/builder/triton/step_create_source_machine.go index bca123508..c3097fae2 100644 --- a/builder/triton/step_create_source_machine.go +++ b/builder/triton/step_create_source_machine.go @@ -1,6 +1,7 @@ package triton import ( + "context" "fmt" "time" diff --git a/builder/triton/step_delete_machine.go b/builder/triton/step_delete_machine.go index 28d27f268..8f9e1bc1f 100644 --- a/builder/triton/step_delete_machine.go +++ b/builder/triton/step_delete_machine.go @@ -1,6 +1,7 @@ package triton import ( + "context" "fmt" "time" diff --git a/builder/triton/step_stop_machine.go b/builder/triton/step_stop_machine.go index 6c01805a5..73fa3f4d6 100644 --- a/builder/triton/step_stop_machine.go +++ b/builder/triton/step_stop_machine.go @@ -1,6 +1,7 @@ package triton import ( + "context" "fmt" "time" diff --git a/builder/triton/step_test.go b/builder/triton/step_test.go index 00fef044a..bccc398c7 100644 --- a/builder/triton/step_test.go +++ b/builder/triton/step_test.go @@ -2,9 +2,10 @@ package triton import ( "bytes" + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/triton/step_wait_for_stop_to_not_fail.go b/builder/triton/step_wait_for_stop_to_not_fail.go index ff777d890..de0a7cc84 100644 --- a/builder/triton/step_wait_for_stop_to_not_fail.go +++ b/builder/triton/step_wait_for_stop_to_not_fail.go @@ -1,6 +1,7 @@ package triton import ( + "context" "time" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/virtualbox/common/step_attach_floppy.go b/builder/virtualbox/common/step_attach_floppy.go index f8c20f3f5..6c73aa4b4 100644 --- a/builder/virtualbox/common/step_attach_floppy.go +++ b/builder/virtualbox/common/step_attach_floppy.go @@ -1,17 +1,16 @@ package common import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "io" "io/ioutil" "log" "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step attaches the ISO to the virtual machine. diff --git a/builder/virtualbox/common/step_attach_floppy_test.go b/builder/virtualbox/common/step_attach_floppy_test.go index 85f8ca0c2..9dba8adf1 100644 --- a/builder/virtualbox/common/step_attach_floppy_test.go +++ b/builder/virtualbox/common/step_attach_floppy_test.go @@ -1,12 +1,11 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepAttachFloppy_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_attach_guest_additions.go b/builder/virtualbox/common/step_attach_guest_additions.go index c6b88d1c8..d5698c372 100644 --- a/builder/virtualbox/common/step_attach_guest_additions.go +++ b/builder/virtualbox/common/step_attach_guest_additions.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // This step attaches the VirtualBox guest additions as a inserted CD onto diff --git a/builder/virtualbox/common/step_configure_vrdp.go b/builder/virtualbox/common/step_configure_vrdp.go index 2cf2659d8..6cc960ad3 100644 --- a/builder/virtualbox/common/step_configure_vrdp.go +++ b/builder/virtualbox/common/step_configure_vrdp.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "math/rand" diff --git a/builder/virtualbox/common/step_download_guest_additions.go b/builder/virtualbox/common/step_download_guest_additions.go index 750f825e5..1aebca144 100644 --- a/builder/virtualbox/common/step_download_guest_additions.go +++ b/builder/virtualbox/common/step_download_guest_additions.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "fmt" "io" "io/ioutil" diff --git a/builder/virtualbox/common/step_export.go b/builder/virtualbox/common/step_export.go index a09b5c01c..03b02e8e4 100644 --- a/builder/virtualbox/common/step_export.go +++ b/builder/virtualbox/common/step_export.go @@ -1,16 +1,15 @@ package common import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "path/filepath" "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step cleans up forwarded ports and exports the VM to an OVF. diff --git a/builder/virtualbox/common/step_export_test.go b/builder/virtualbox/common/step_export_test.go index fee2cafdb..1bea8df57 100644 --- a/builder/virtualbox/common/step_export_test.go +++ b/builder/virtualbox/common/step_export_test.go @@ -1,10 +1,9 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepExport_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_forward_ssh.go b/builder/virtualbox/common/step_forward_ssh.go index 4bcd2dc66..b4e3b2f25 100644 --- a/builder/virtualbox/common/step_forward_ssh.go +++ b/builder/virtualbox/common/step_forward_ssh.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "math/rand" diff --git a/builder/virtualbox/common/step_output_dir.go b/builder/virtualbox/common/step_output_dir.go index cad96b98e..fc39d08b2 100644 --- a/builder/virtualbox/common/step_output_dir.go +++ b/builder/virtualbox/common/step_output_dir.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" diff --git a/builder/virtualbox/common/step_output_dir_test.go b/builder/virtualbox/common/step_output_dir_test.go index 48f4634f4..5066e0e56 100644 --- a/builder/virtualbox/common/step_output_dir_test.go +++ b/builder/virtualbox/common/step_output_dir_test.go @@ -1,12 +1,11 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testStepOutputDir(t *testing.T) *StepOutputDir { diff --git a/builder/virtualbox/common/step_remove_devices.go b/builder/virtualbox/common/step_remove_devices.go index 4a4a24a9e..835fd5af8 100644 --- a/builder/virtualbox/common/step_remove_devices.go +++ b/builder/virtualbox/common/step_remove_devices.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" diff --git a/builder/virtualbox/common/step_remove_devices_test.go b/builder/virtualbox/common/step_remove_devices_test.go index 9a2e8ee3a..0d9f6bbe9 100644 --- a/builder/virtualbox/common/step_remove_devices_test.go +++ b/builder/virtualbox/common/step_remove_devices_test.go @@ -1,10 +1,9 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepRemoveDevices_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_run.go b/builder/virtualbox/common/step_run.go index 391d8c25e..62d98d894 100644 --- a/builder/virtualbox/common/step_run.go +++ b/builder/virtualbox/common/step_run.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "time" diff --git a/builder/virtualbox/common/step_shutdown.go b/builder/virtualbox/common/step_shutdown.go index 7acf97683..af2539cac 100644 --- a/builder/virtualbox/common/step_shutdown.go +++ b/builder/virtualbox/common/step_shutdown.go @@ -1,15 +1,14 @@ package common import ( + "context" "errors" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step shuts down the machine. It first attempts to do so gracefully, diff --git a/builder/virtualbox/common/step_shutdown_test.go b/builder/virtualbox/common/step_shutdown_test.go index aa36a6c91..d38b3378c 100644 --- a/builder/virtualbox/common/step_shutdown_test.go +++ b/builder/virtualbox/common/step_shutdown_test.go @@ -1,13 +1,11 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "testing" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) func TestStepShutdown_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_suppress_messages.go b/builder/virtualbox/common/step_suppress_messages.go index 1805a0535..369911bdb 100644 --- a/builder/virtualbox/common/step_suppress_messages.go +++ b/builder/virtualbox/common/step_suppress_messages.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // This step sets some variables in VirtualBox so that annoying diff --git a/builder/virtualbox/common/step_suppress_messages_test.go b/builder/virtualbox/common/step_suppress_messages_test.go index d5609d456..ad3a59fd7 100644 --- a/builder/virtualbox/common/step_suppress_messages_test.go +++ b/builder/virtualbox/common/step_suppress_messages_test.go @@ -2,10 +2,9 @@ package common import ( "errors" - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepSuppressMessages_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_test.go b/builder/virtualbox/common/step_test.go index ec0854415..c8a12abb6 100644 --- a/builder/virtualbox/common/step_test.go +++ b/builder/virtualbox/common/step_test.go @@ -2,9 +2,10 @@ package common import ( "bytes" + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/virtualbox/common/step_type_boot_command.go b/builder/virtualbox/common/step_type_boot_command.go index 997805732..cb5b43648 100644 --- a/builder/virtualbox/common/step_type_boot_command.go +++ b/builder/virtualbox/common/step_type_boot_command.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "strings" diff --git a/builder/virtualbox/common/step_upload_guest_additions.go b/builder/virtualbox/common/step_upload_guest_additions.go index 6de891ffd..c77ef7d22 100644 --- a/builder/virtualbox/common/step_upload_guest_additions.go +++ b/builder/virtualbox/common/step_upload_guest_additions.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" diff --git a/builder/virtualbox/common/step_upload_version.go b/builder/virtualbox/common/step_upload_version.go index fa154c7ae..deaf8824d 100644 --- a/builder/virtualbox/common/step_upload_version.go +++ b/builder/virtualbox/common/step_upload_version.go @@ -2,10 +2,12 @@ package common import ( "bytes" + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // This step uploads a file containing the VirtualBox version, which diff --git a/builder/virtualbox/common/step_upload_version_test.go b/builder/virtualbox/common/step_upload_version_test.go index cfd940a4b..17609b9aa 100644 --- a/builder/virtualbox/common/step_upload_version_test.go +++ b/builder/virtualbox/common/step_upload_version_test.go @@ -1,9 +1,10 @@ package common import ( + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func TestStepUploadVersion_impl(t *testing.T) { diff --git a/builder/virtualbox/common/step_vboxmanage.go b/builder/virtualbox/common/step_vboxmanage.go index 54ef96e0f..948cae884 100644 --- a/builder/virtualbox/common/step_vboxmanage.go +++ b/builder/virtualbox/common/step_vboxmanage.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "strings" diff --git a/builder/virtualbox/iso/step_attach_iso.go b/builder/virtualbox/iso/step_attach_iso.go index 3c9fcc55e..619d61afd 100644 --- a/builder/virtualbox/iso/step_attach_iso.go +++ b/builder/virtualbox/iso/step_attach_iso.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" diff --git a/builder/virtualbox/iso/step_create_disk.go b/builder/virtualbox/iso/step_create_disk.go index cb67af807..7c5b03e4f 100644 --- a/builder/virtualbox/iso/step_create_disk.go +++ b/builder/virtualbox/iso/step_create_disk.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" diff --git a/builder/virtualbox/iso/step_create_vm.go b/builder/virtualbox/iso/step_create_vm.go index 81a8a0304..72a556737 100644 --- a/builder/virtualbox/iso/step_create_vm.go +++ b/builder/virtualbox/iso/step_create_vm.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" diff --git a/builder/virtualbox/ovf/step_import.go b/builder/virtualbox/ovf/step_import.go index 8ebf5fe4b..5e066d83a 100644 --- a/builder/virtualbox/ovf/step_import.go +++ b/builder/virtualbox/ovf/step_import.go @@ -1,6 +1,7 @@ package ovf import ( + "context" "fmt" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" diff --git a/builder/virtualbox/ovf/step_import_test.go b/builder/virtualbox/ovf/step_import_test.go index aec090980..45054585c 100644 --- a/builder/virtualbox/ovf/step_import_test.go +++ b/builder/virtualbox/ovf/step_import_test.go @@ -5,7 +5,6 @@ import ( vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" "github.com/hashicorp/packer/helper/multistep" - "testing" ) func TestStepImport_impl(t *testing.T) { diff --git a/builder/virtualbox/ovf/step_test.go b/builder/virtualbox/ovf/step_test.go index eb6522ef6..4f9a0f9d8 100644 --- a/builder/virtualbox/ovf/step_test.go +++ b/builder/virtualbox/ovf/step_test.go @@ -7,7 +7,6 @@ import ( vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/common/step_clean_files.go b/builder/vmware/common/step_clean_files.go index 676e08f2f..08d14cf63 100644 --- a/builder/vmware/common/step_clean_files.go +++ b/builder/vmware/common/step_clean_files.go @@ -1,14 +1,13 @@ package common import ( + "context" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "os" "path/filepath" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // These are the extensions of files that are important for the function diff --git a/builder/vmware/common/step_clean_vmx.go b/builder/vmware/common/step_clean_vmx.go index 12cc6b223..f112227f8 100644 --- a/builder/vmware/common/step_clean_vmx.go +++ b/builder/vmware/common/step_clean_vmx.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "regexp" diff --git a/builder/vmware/common/step_compact_disk.go b/builder/vmware/common/step_compact_disk.go index cf0c4cf19..e7823e3ba 100644 --- a/builder/vmware/common/step_compact_disk.go +++ b/builder/vmware/common/step_compact_disk.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // This step compacts the virtual disk for the VM unless the "skip_compaction" diff --git a/builder/vmware/common/step_configure_vmx.go b/builder/vmware/common/step_configure_vmx.go index 369712b6e..155234ac4 100644 --- a/builder/vmware/common/step_configure_vmx.go +++ b/builder/vmware/common/step_configure_vmx.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "log" diff --git a/builder/vmware/common/step_configure_vnc.go b/builder/vmware/common/step_configure_vnc.go index 1f18ce5bf..90aa4a998 100644 --- a/builder/vmware/common/step_configure_vnc.go +++ b/builder/vmware/common/step_configure_vnc.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "log" diff --git a/builder/vmware/common/step_output_dir.go b/builder/vmware/common/step_output_dir.go index 35effe138..90c71e18a 100644 --- a/builder/vmware/common/step_output_dir.go +++ b/builder/vmware/common/step_output_dir.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "time" diff --git a/builder/vmware/common/step_output_dir_test.go b/builder/vmware/common/step_output_dir_test.go index cdfba2a2e..dd1326387 100644 --- a/builder/vmware/common/step_output_dir_test.go +++ b/builder/vmware/common/step_output_dir_test.go @@ -1,12 +1,11 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "io/ioutil" "os" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func testOutputDir(t *testing.T) *LocalOutputDir { diff --git a/builder/vmware/common/step_prepare_tools.go b/builder/vmware/common/step_prepare_tools.go index 3ce771387..72f8f1488 100644 --- a/builder/vmware/common/step_prepare_tools.go +++ b/builder/vmware/common/step_prepare_tools.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "os" diff --git a/builder/vmware/common/step_run.go b/builder/vmware/common/step_run.go index 14334e779..f85d5948f 100644 --- a/builder/vmware/common/step_run.go +++ b/builder/vmware/common/step_run.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "time" diff --git a/builder/vmware/common/step_run_test.go b/builder/vmware/common/step_run_test.go index 395575231..b884351dd 100644 --- a/builder/vmware/common/step_run_test.go +++ b/builder/vmware/common/step_run_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" diff --git a/builder/vmware/common/step_shutdown.go b/builder/vmware/common/step_shutdown.go index 5067ebbb2..bc8490ff3 100644 --- a/builder/vmware/common/step_shutdown.go +++ b/builder/vmware/common/step_shutdown.go @@ -2,17 +2,16 @@ package common import ( "bytes" + "context" "errors" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "regexp" "strings" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // This step shuts down the machine. It first attempts to do so gracefully, diff --git a/builder/vmware/common/step_suppress_messages.go b/builder/vmware/common/step_suppress_messages.go index 3e8721dec..02928123a 100644 --- a/builder/vmware/common/step_suppress_messages.go +++ b/builder/vmware/common/step_suppress_messages.go @@ -1,10 +1,12 @@ package common import ( + "context" "fmt" + "log" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // This step suppresses any messages that VMware product might show. diff --git a/builder/vmware/common/step_test.go b/builder/vmware/common/step_test.go index ec0854415..c8a12abb6 100644 --- a/builder/vmware/common/step_test.go +++ b/builder/vmware/common/step_test.go @@ -2,9 +2,10 @@ package common import ( "bytes" + "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/common/step_type_boot_command.go b/builder/vmware/common/step_type_boot_command.go index 8e6a66366..05c66de16 100644 --- a/builder/vmware/common/step_type_boot_command.go +++ b/builder/vmware/common/step_type_boot_command.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "net" diff --git a/builder/vmware/common/step_upload_tools.go b/builder/vmware/common/step_upload_tools.go index 4dff6496e..eed55ab0b 100644 --- a/builder/vmware/common/step_upload_tools.go +++ b/builder/vmware/common/step_upload_tools.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "os" diff --git a/builder/vmware/iso/step_create_disk.go b/builder/vmware/iso/step_create_disk.go index 457236034..ddee55c7f 100644 --- a/builder/vmware/iso/step_create_disk.go +++ b/builder/vmware/iso/step_create_disk.go @@ -1,13 +1,13 @@ package iso import ( + "context" "fmt" "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "path/filepath" ) // This step creates the virtual disks for the VM. diff --git a/builder/vmware/iso/step_create_vmx.go b/builder/vmware/iso/step_create_vmx.go index a071ed0f1..029f2a31e 100644 --- a/builder/vmware/iso/step_create_vmx.go +++ b/builder/vmware/iso/step_create_vmx.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" "io/ioutil" "os" diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index 4d08af159..4f6df9ed4 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -2,6 +2,7 @@ package iso import ( "bytes" + "context" "fmt" "net/url" "os" diff --git a/builder/vmware/iso/step_export_test.go b/builder/vmware/iso/step_export_test.go index a713620e6..c41b2550b 100644 --- a/builder/vmware/iso/step_export_test.go +++ b/builder/vmware/iso/step_export_test.go @@ -1,10 +1,9 @@ package iso import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepExport_impl(t *testing.T) { diff --git a/builder/vmware/iso/step_register.go b/builder/vmware/iso/step_register.go index e1d396ab1..c97800910 100644 --- a/builder/vmware/iso/step_register.go +++ b/builder/vmware/iso/step_register.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" "time" diff --git a/builder/vmware/iso/step_register_test.go b/builder/vmware/iso/step_register_test.go index 6199696f0..0d2aaaa97 100644 --- a/builder/vmware/iso/step_register_test.go +++ b/builder/vmware/iso/step_register_test.go @@ -1,10 +1,9 @@ package iso import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepRegister_impl(t *testing.T) { diff --git a/builder/vmware/iso/step_remote_upload.go b/builder/vmware/iso/step_remote_upload.go index 427ba28c6..c4dfda8e5 100644 --- a/builder/vmware/iso/step_remote_upload.go +++ b/builder/vmware/iso/step_remote_upload.go @@ -1,13 +1,13 @@ package iso import ( + "context" "fmt" "log" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "log" ) // stepRemoteUpload uploads some thing from the state bag to a remote driver diff --git a/builder/vmware/iso/step_test.go b/builder/vmware/iso/step_test.go index 66fc38d36..958ab4734 100644 --- a/builder/vmware/iso/step_test.go +++ b/builder/vmware/iso/step_test.go @@ -7,7 +7,6 @@ import ( vmwcommon "github.com/hashicorp/packer/builder/vmware/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "testing" ) func testState(t *testing.T) multistep.StateBag { diff --git a/builder/vmware/iso/step_upload_vmx.go b/builder/vmware/iso/step_upload_vmx.go index 360372765..f0fec436c 100644 --- a/builder/vmware/iso/step_upload_vmx.go +++ b/builder/vmware/iso/step_upload_vmx.go @@ -1,13 +1,13 @@ package iso import ( + "context" "fmt" "path/filepath" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "path/filepath" ) // This step upload the VMX to the remote host diff --git a/builder/vmware/vmx/step_clone_vmx.go b/builder/vmware/vmx/step_clone_vmx.go index e65ea0dca..f7874067c 100644 --- a/builder/vmware/vmx/step_clone_vmx.go +++ b/builder/vmware/vmx/step_clone_vmx.go @@ -1,6 +1,7 @@ package vmx import ( + "context" "fmt" "log" "path/filepath" diff --git a/common/multistep_debug.go b/common/multistep_debug.go index 1a5fc9f10..2d1a58291 100644 --- a/common/multistep_debug.go +++ b/common/multistep_debug.go @@ -2,13 +2,11 @@ package common import ( "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // MultistepDebugFn will return a proper multistep.DebugPauseFn to diff --git a/common/step_create_floppy.go b/common/step_create_floppy.go index 8b0ef8b83..dd4ead840 100644 --- a/common/step_create_floppy.go +++ b/common/step_create_floppy.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io" "io/ioutil" diff --git a/common/step_create_floppy_test.go b/common/step_create_floppy_test.go index a84c64677..2128e4dd7 100644 --- a/common/step_create_floppy_test.go +++ b/common/step_create_floppy_test.go @@ -3,8 +3,6 @@ package common import ( "bytes" "fmt" - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" "io/ioutil" "log" "os" @@ -14,8 +12,8 @@ import ( "strings" "testing" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) const TestFixtures = "test-fixtures" diff --git a/common/step_download.go b/common/step_download.go index bdcd7ac65..ac62fa698 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -1,6 +1,7 @@ package common import ( + "context" "crypto/sha1" "encoding/hex" "fmt" diff --git a/common/step_download_test.go b/common/step_download_test.go index 86d632867..2b6476614 100644 --- a/common/step_download_test.go +++ b/common/step_download_test.go @@ -1,10 +1,9 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepDownload_Impl(t *testing.T) { diff --git a/common/step_http_server.go b/common/step_http_server.go index 70b1e1460..e90c6ef60 100644 --- a/common/step_http_server.go +++ b/common/step_http_server.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "io/ioutil" "log" diff --git a/common/step_provision.go b/common/step_provision.go index 971ef97fb..9c842044b 100644 --- a/common/step_provision.go +++ b/common/step_provision.go @@ -1,13 +1,12 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" - "github.com/hashicorp/packer/packer" + "context" "log" "time" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" - "github.com/mitchellh/multistep" ) // StepProvision runs the provisioners. diff --git a/common/step_provision_test.go b/common/step_provision_test.go index f7c40b51d..a37d7681b 100644 --- a/common/step_provision_test.go +++ b/common/step_provision_test.go @@ -1,10 +1,9 @@ package common import ( - "github.com/hashicorp/packer/helper/multistep" "testing" - "github.com/mitchellh/multistep" + "github.com/hashicorp/packer/helper/multistep" ) func TestStepProvision_Impl(t *testing.T) { diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index 67a5eebbe..541f88fe1 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -1,6 +1,7 @@ package communicator import ( + "context" "fmt" "log" diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index 2f3ae3666..680b88a02 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -1,6 +1,7 @@ package communicator import ( + "context" "errors" "fmt" "log" diff --git a/helper/communicator/step_connect_winrm.go b/helper/communicator/step_connect_winrm.go index 97e7805d6..06e6236f8 100644 --- a/helper/communicator/step_connect_winrm.go +++ b/helper/communicator/step_connect_winrm.go @@ -2,6 +2,7 @@ package communicator import ( "bytes" + "context" "errors" "fmt" "io" diff --git a/post-processor/vagrant-cloud/step_create_provider.go b/post-processor/vagrant-cloud/step_create_provider.go index 028e5c6c7..e664b8b19 100644 --- a/post-processor/vagrant-cloud/step_create_provider.go +++ b/post-processor/vagrant-cloud/step_create_provider.go @@ -1,7 +1,9 @@ package vagrantcloud import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/post-processor/vagrant-cloud/step_create_version.go b/post-processor/vagrant-cloud/step_create_version.go index d8e6b9df8..feb247f0a 100644 --- a/post-processor/vagrant-cloud/step_create_version.go +++ b/post-processor/vagrant-cloud/step_create_version.go @@ -1,7 +1,9 @@ package vagrantcloud import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) diff --git a/post-processor/vagrant-cloud/step_prepare_upload.go b/post-processor/vagrant-cloud/step_prepare_upload.go index 1bcc05885..bdab16d10 100644 --- a/post-processor/vagrant-cloud/step_prepare_upload.go +++ b/post-processor/vagrant-cloud/step_prepare_upload.go @@ -1,6 +1,7 @@ package vagrantcloud import ( + "context" "fmt" "github.com/hashicorp/packer/helper/multistep" diff --git a/post-processor/vagrant-cloud/step_release_version.go b/post-processor/vagrant-cloud/step_release_version.go index 5f7fbb0f0..94e4b90da 100644 --- a/post-processor/vagrant-cloud/step_release_version.go +++ b/post-processor/vagrant-cloud/step_release_version.go @@ -1,6 +1,7 @@ package vagrantcloud import ( + "context" "fmt" "strings" diff --git a/post-processor/vagrant-cloud/step_upload.go b/post-processor/vagrant-cloud/step_upload.go index 576558b24..cce1e9de2 100644 --- a/post-processor/vagrant-cloud/step_upload.go +++ b/post-processor/vagrant-cloud/step_upload.go @@ -1,6 +1,7 @@ package vagrantcloud import ( + "context" "fmt" "log" diff --git a/post-processor/vagrant-cloud/step_verify_box.go b/post-processor/vagrant-cloud/step_verify_box.go index baee6222a..f1dafc991 100644 --- a/post-processor/vagrant-cloud/step_verify_box.go +++ b/post-processor/vagrant-cloud/step_verify_box.go @@ -1,7 +1,9 @@ package vagrantcloud import ( + "context" "fmt" + "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) From 5d48d658b477c303ba65595e40cd2aca121534c4 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 15:29:42 -0800 Subject: [PATCH 12/19] Wire context through misc steps Some steps actually need to pass the context around, so let's create a ctx variable and pass it. --- .../virtualbox/common/step_download_guest_additions.go | 10 +++++----- common/multistep_runner.go | 9 +++++---- helper/communicator/step_connect.go | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/builder/virtualbox/common/step_download_guest_additions.go b/builder/virtualbox/common/step_download_guest_additions.go index 1aebca144..facc60b6a 100644 --- a/builder/virtualbox/common/step_download_guest_additions.go +++ b/builder/virtualbox/common/step_download_guest_additions.go @@ -37,7 +37,7 @@ type StepDownloadGuestAdditions struct { Ctx interpolate.Context } -func (s *StepDownloadGuestAdditions) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepDownloadGuestAdditions) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { var action multistep.StepAction driver := state.Get("driver").(Driver) ui := state.Get("ui").(packer.Ui) @@ -114,7 +114,7 @@ func (s *StepDownloadGuestAdditions) Run(_ context.Context, state multistep.Stat if s.GuestAdditionsSHA256 != "" { checksum = s.GuestAdditionsSHA256 } else { - checksum, action = s.downloadAdditionsSHA256(state, version, additionsName) + checksum, action = s.downloadAdditionsSHA256(ctx, state, version, additionsName) if action != multistep.ActionContinue { return action } @@ -141,12 +141,12 @@ func (s *StepDownloadGuestAdditions) Run(_ context.Context, state multistep.Stat Url: []string{url}, } - return downStep.Run(state) + return downStep.Run(ctx, state) } func (s *StepDownloadGuestAdditions) Cleanup(state multistep.StateBag) {} -func (s *StepDownloadGuestAdditions) downloadAdditionsSHA256(state multistep.StateBag, additionsVersion string, additionsName string) (string, multistep.StepAction) { +func (s *StepDownloadGuestAdditions) downloadAdditionsSHA256(ctx context.Context, state multistep.StateBag, additionsVersion string, additionsName string) (string, multistep.StepAction) { // First things first, we get the list of checksums for the files available // for this version. checksumsUrl := fmt.Sprintf( @@ -170,7 +170,7 @@ func (s *StepDownloadGuestAdditions) downloadAdditionsSHA256(state multistep.Sta Url: []string{checksumsUrl}, } - action := downStep.Run(state) + action := downStep.Run(ctx, state) if action == multistep.ActionHalt { return "", action } diff --git a/common/multistep_runner.go b/common/multistep_runner.go index c10c0879e..e3c16e7cf 100644 --- a/common/multistep_runner.go +++ b/common/multistep_runner.go @@ -1,6 +1,7 @@ package common import ( + "context" "fmt" "log" "os" @@ -65,8 +66,8 @@ func (s abortStep) InnerStepName() string { return typeName(s.step) } -func (s abortStep) Run(state multistep.StateBag) multistep.StepAction { - return s.step.Run(state) +func (s abortStep) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { + return s.step.Run(ctx, state) } func (s abortStep) Cleanup(state multistep.StateBag) { @@ -90,9 +91,9 @@ func (s askStep) InnerStepName() string { return typeName(s.step) } -func (s askStep) Run(state multistep.StateBag) (action multistep.StepAction) { +func (s askStep) Run(ctx context.Context, state multistep.StateBag) (action multistep.StepAction) { for { - action = s.step.Run(state) + action = s.step.Run(ctx, state) if action != multistep.ActionHalt { return diff --git a/helper/communicator/step_connect.go b/helper/communicator/step_connect.go index 541f88fe1..273935710 100644 --- a/helper/communicator/step_connect.go +++ b/helper/communicator/step_connect.go @@ -44,7 +44,7 @@ type StepConnect struct { substep multistep.Step } -func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { +func (s *StepConnect) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { typeMap := map[string]multistep.Step{ "none": nil, "ssh": &StepConnectSSH{ @@ -85,7 +85,7 @@ func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep } s.substep = step - return s.substep.Run(state) + return s.substep.Run(ctx, state) } func (s *StepConnect) Cleanup(state multistep.StateBag) { From 8cd403425e821c6413e3e172d84b14c9cb87c6e9 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 16:03:49 -0800 Subject: [PATCH 13/19] test fixes WIP --- builder/azure/arm/step_capture_image_test.go | 7 ++++--- .../arm/step_create_resource_group_test.go | 15 ++++++++------- builder/azure/arm/step_delete_os_disk_test.go | 19 ++++++++++--------- .../arm/step_delete_resource_group_test.go | 7 ++++--- .../azure/arm/step_deploy_template_test.go | 7 ++++--- .../azure/arm/step_get_certificate_test.go | 7 ++++--- builder/azure/arm/step_get_ip_address_test.go | 7 ++++--- builder/azure/arm/step_get_os_disk_test.go | 7 ++++--- .../azure/arm/step_power_off_compute_test.go | 7 ++++--- .../azure/arm/step_set_certificate_test.go | 5 +++-- .../azure/arm/step_validate_template_test.go | 7 ++++--- builder/docker/step_commit_test.go | 5 +++-- builder/docker/step_export_test.go | 5 +++-- builder/docker/step_pull_test.go | 9 +++++---- builder/docker/step_run_test.go | 6 +++--- builder/docker/step_temp_dir_test.go | 3 ++- .../step_check_existing_image_test.go | 3 ++- .../googlecompute/step_create_image_test.go | 5 +++-- .../step_create_instance_test.go | 15 ++++++++------- .../googlecompute/step_create_ssh_key_test.go | 8 +++++--- .../step_create_windows_password_test.go | 13 +++++++------ .../googlecompute/step_instance_info_test.go | 11 ++++++----- .../step_teardown_instance_test.go | 3 ++- .../step_wait_startup_script_test.go | 3 ++- builder/hyperv/iso/builder_test.go | 3 ++- builder/hyperv/vmcx/builder_test.go | 3 ++- .../oracle/oci/step_create_instance_test.go | 11 ++++++----- builder/oracle/oci/step_image_test.go | 7 ++++--- builder/oracle/oci/step_instance_info_test.go | 5 +++-- .../common/step_attach_floppy_test.go | 5 +++-- .../common/step_compact_disk_test.go | 5 +++-- .../parallels/common/step_output_dir_test.go | 7 ++++--- .../step_prepare_parallels_tools_test.go | 7 ++++--- .../parallels/common/step_shutdown_test.go | 7 ++++--- .../common/step_type_boot_command_test.go | 3 ++- .../step_upload_parallels_tools_test.go | 7 ++++--- .../common/step_upload_version_test.go | 5 +++-- .../step_create_image_from_machine_test.go | 7 ++++--- .../triton/step_create_source_machine_test.go | 13 +++++++------ builder/triton/step_delete_machine_test.go | 7 ++++--- builder/triton/step_stop_machine_test.go | 7 ++++--- .../common/step_attach_floppy_test.go | 5 +++-- builder/virtualbox/common/step_export_test.go | 3 ++- .../virtualbox/common/step_output_dir_test.go | 9 +++++---- .../common/step_remove_devices_test.go | 9 +++++---- .../virtualbox/common/step_shutdown_test.go | 11 ++++++----- .../common/step_suppress_messages_test.go | 5 +++-- .../common/step_upload_version_test.go | 5 +++-- builder/virtualbox/ovf/step_import_test.go | 3 ++- builder/vmware/common/step_clean_vmx_test.go | 9 +++++---- .../vmware/common/step_compact_disk_test.go | 5 +++-- .../vmware/common/step_configure_vmx_test.go | 7 ++++--- builder/vmware/common/step_output_dir_test.go | 11 ++++++----- .../vmware/common/step_prepare_tools_test.go | 7 ++++--- builder/vmware/common/step_run_test.go | 6 +++--- builder/vmware/common/step_shutdown_test.go | 7 ++++--- .../common/step_suppress_messages_test.go | 3 ++- builder/vmware/iso/step_export_test.go | 3 ++- builder/vmware/iso/step_register_test.go | 7 ++++--- builder/vmware/vmx/step_clone_vmx_test.go | 3 ++- common/step_create_floppy_test.go | 9 +++++---- helper/communicator/step_connect_test.go | 3 ++- 62 files changed, 242 insertions(+), 181 deletions(-) diff --git a/builder/azure/arm/step_capture_image_test.go b/builder/azure/arm/step_capture_image_test.go index 2d005d32b..52bcbd1b7 100644 --- a/builder/azure/arm/step_capture_image_test.go +++ b/builder/azure/arm/step_capture_image_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -26,7 +27,7 @@ func TestStepCaptureImageShouldFailIfCaptureFails(t *testing.T) { stateBag := createTestStateBagStepCaptureImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -51,7 +52,7 @@ func TestStepCaptureImageShouldPassIfCapturePasses(t *testing.T) { stateBag := createTestStateBagStepCaptureImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -91,7 +92,7 @@ func TestStepCaptureImageShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepCaptureImage() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_create_resource_group_test.go b/builder/azure/arm/step_create_resource_group_test.go index 07ffb78ab..3c4deeb03 100644 --- a/builder/azure/arm/step_create_resource_group_test.go +++ b/builder/azure/arm/step_create_resource_group_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "errors" "fmt" "testing" @@ -26,7 +27,7 @@ func TestStepCreateResourceGroupShouldFailIfBothGroupNames(t *testing.T) { error: func(e error) {}, exists: func(string) (bool, error) { return false, nil }, } - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -46,7 +47,7 @@ func TestStepCreateResourceGroupShouldFailIfCreateFails(t *testing.T) { stateBag := createTestStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -66,7 +67,7 @@ func TestStepCreateResourceGroupShouldFailIfExistsFails(t *testing.T) { stateBag := createTestStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -86,7 +87,7 @@ func TestStepCreateResourceGroupShouldPassIfCreatePasses(t *testing.T) { stateBag := createTestStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -114,7 +115,7 @@ func TestStepCreateResourceGroupShouldTakeStepArgumentsFromStateBag(t *testing.T } stateBag := createTestStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) @@ -152,7 +153,7 @@ func TestStepCreateResourceGroupMarkShouldFailIfTryingExistingButDoesntExist(t * stateBag := createTestExistingStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -172,7 +173,7 @@ func TestStepCreateResourceGroupMarkShouldFailIfTryingTempButExist(t *testing.T) stateBag := createTestStateBagStepCreateResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } diff --git a/builder/azure/arm/step_delete_os_disk_test.go b/builder/azure/arm/step_delete_os_disk_test.go index fea47e766..6c8b12550 100644 --- a/builder/azure/arm/step_delete_os_disk_test.go +++ b/builder/azure/arm/step_delete_os_disk_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "errors" "fmt" "testing" @@ -19,7 +20,7 @@ func TestStepDeleteOSDiskShouldFailIfGetFails(t *testing.T) { stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -38,7 +39,7 @@ func TestStepDeleteOSDiskShouldPassIfGetPasses(t *testing.T) { stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -63,7 +64,7 @@ func TestStepDeleteOSDiskShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/images/pkrvm_os.vhd") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) @@ -93,7 +94,7 @@ func TestStepDeleteOSDiskShouldHandleComplexStorageContainerNames(t *testing.T) } stateBag := DeleteTestStateBagStepDeleteOSDisk("http://storage.blob.core.windows.net/abc/def/pkrvm_os.vhd") - testSubject.Run(stateBag) + testSubject.Run(context.Background(), stateBag) if actualStorageContainerName != "abc" { t.Fatalf("Expected the storage container name to be 'abc/def', but found '%s'.", actualStorageContainerName) @@ -115,7 +116,7 @@ func TestStepDeleteOSDiskShouldFailIfVHDNameCannotBeURLParsed(t *testing.T) { // Invalid URL per https://golang.org/src/net/url/url_test.go stateBag := DeleteTestStateBagStepDeleteOSDisk("http://[fe80::1%en0]/") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%v'.", result) } @@ -134,7 +135,7 @@ func TestStepDeleteOSDiskShouldFailIfVHDNameIsTooShort(t *testing.T) { stateBag := DeleteTestStateBagStepDeleteOSDisk("storage.blob.core.windows.net/abc") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -157,7 +158,7 @@ func TestStepDeleteOSDiskShouldPassIfManagedDiskInTempResourceGroup(t *testing.T stateBag.Put(constants.ArmIsExistingResourceGroup, false) stateBag.Put(constants.ArmResourceGroupName, "testgroup") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -181,7 +182,7 @@ func TestStepDeleteOSDiskShouldFailIfManagedDiskInExistingResourceGroupFailsToDe stateBag.Put(constants.ArmIsExistingResourceGroup, true) stateBag.Put(constants.ArmResourceGroupName, "testgroup") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -205,7 +206,7 @@ func TestStepDeleteOSDiskShouldFailIfManagedDiskInExistingResourceGroupIsDeleted stateBag.Put(constants.ArmIsExistingResourceGroup, true) stateBag.Put(constants.ArmResourceGroupName, "testgroup") - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } diff --git a/builder/azure/arm/step_delete_resource_group_test.go b/builder/azure/arm/step_delete_resource_group_test.go index 8b5e3590b..823f1f6ac 100644 --- a/builder/azure/arm/step_delete_resource_group_test.go +++ b/builder/azure/arm/step_delete_resource_group_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -17,7 +18,7 @@ func TestStepDeleteResourceGroupShouldFailIfDeleteFails(t *testing.T) { stateBag := DeleteTestStateBagStepDeleteResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -36,7 +37,7 @@ func TestStepDeleteResourceGroupShouldPassIfDeletePasses(t *testing.T) { stateBag := DeleteTestStateBagStepDeleteResourceGroup() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -56,7 +57,7 @@ func TestStepDeleteResourceGroupShouldDeleteStateBagArmResourceGroupCreated(t *t } stateBag := DeleteTestStateBagStepDeleteResourceGroup() - testSubject.Run(stateBag) + testSubject.Run(context.Background(), stateBag) value, ok := stateBag.GetOk(constants.ArmIsResourceGroupCreated) if !ok { diff --git a/builder/azure/arm/step_deploy_template_test.go b/builder/azure/arm/step_deploy_template_test.go index 16bb52692..be60433f3 100644 --- a/builder/azure/arm/step_deploy_template_test.go +++ b/builder/azure/arm/step_deploy_template_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -19,7 +20,7 @@ func TestStepDeployTemplateShouldFailIfDeployFails(t *testing.T) { stateBag := createTestStateBagStepDeployTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -38,7 +39,7 @@ func TestStepDeployTemplateShouldPassIfDeployPasses(t *testing.T) { stateBag := createTestStateBagStepDeployTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -65,7 +66,7 @@ func TestStepDeployTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_get_certificate_test.go b/builder/azure/arm/step_get_certificate_test.go index 6823ca1f1..5ce807afe 100644 --- a/builder/azure/arm/step_get_certificate_test.go +++ b/builder/azure/arm/step_get_certificate_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -18,7 +19,7 @@ func TestStepGetCertificateShouldFailIfGetFails(t *testing.T) { stateBag := createTestStateBagStepGetCertificate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -38,7 +39,7 @@ func TestStepGetCertificateShouldPassIfGetPasses(t *testing.T) { stateBag := createTestStateBagStepGetCertificate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -65,7 +66,7 @@ func TestStepGetCertificateShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepGetCertificate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_get_ip_address_test.go b/builder/azure/arm/step_get_ip_address_test.go index 508aa2b08..e91678c3b 100644 --- a/builder/azure/arm/step_get_ip_address_test.go +++ b/builder/azure/arm/step_get_ip_address_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -21,7 +22,7 @@ func TestStepGetIPAddressShouldFailIfGetFails(t *testing.T) { stateBag := createTestStateBagStepGetIPAddress() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -45,7 +46,7 @@ func TestStepGetIPAddressShouldPassIfGetPasses(t *testing.T) { stateBag := createTestStateBagStepGetIPAddress() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -77,7 +78,7 @@ func TestStepGetIPAddressShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepGetIPAddress() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_get_os_disk_test.go b/builder/azure/arm/step_get_os_disk_test.go index 614684db7..070a3ec0a 100644 --- a/builder/azure/arm/step_get_os_disk_test.go +++ b/builder/azure/arm/step_get_os_disk_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -22,7 +23,7 @@ func TestStepGetOSDiskShouldFailIfGetFails(t *testing.T) { stateBag := createTestStateBagStepGetOSDisk() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -43,7 +44,7 @@ func TestStepGetOSDiskShouldPassIfGetPasses(t *testing.T) { stateBag := createTestStateBagStepGetOSDisk() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -69,7 +70,7 @@ func TestStepGetOSDiskShouldTakeValidateArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepGetOSDisk() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_power_off_compute_test.go b/builder/azure/arm/step_power_off_compute_test.go index e1d6c6b7d..45c7a1729 100644 --- a/builder/azure/arm/step_power_off_compute_test.go +++ b/builder/azure/arm/step_power_off_compute_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -17,7 +18,7 @@ func TestStepPowerOffComputeShouldFailIfPowerOffFails(t *testing.T) { stateBag := createTestStateBagStepPowerOffCompute() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -36,7 +37,7 @@ func TestStepPowerOffComputeShouldPassIfPowerOffPasses(t *testing.T) { stateBag := createTestStateBagStepPowerOffCompute() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -62,7 +63,7 @@ func TestStepPowerOffComputeShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepPowerOffCompute() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_set_certificate_test.go b/builder/azure/arm/step_set_certificate_test.go index 8adc6f19e..387d620a9 100644 --- a/builder/azure/arm/step_set_certificate_test.go +++ b/builder/azure/arm/step_set_certificate_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "testing" "github.com/hashicorp/packer/builder/azure/common/constants" @@ -16,7 +17,7 @@ func TestStepSetCertificateShouldPassIfGetPasses(t *testing.T) { stateBag := createTestStateBagStepSetCertificate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -35,7 +36,7 @@ func TestStepSetCertificateShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepSetCertificate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/azure/arm/step_validate_template_test.go b/builder/azure/arm/step_validate_template_test.go index 310c6b49c..7e32625d1 100644 --- a/builder/azure/arm/step_validate_template_test.go +++ b/builder/azure/arm/step_validate_template_test.go @@ -1,6 +1,7 @@ package arm import ( + "context" "fmt" "testing" @@ -17,7 +18,7 @@ func TestStepValidateTemplateShouldFailIfValidateFails(t *testing.T) { stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionHalt { t.Fatalf("Expected the step to return 'ActionHalt', but got '%d'.", result) } @@ -36,7 +37,7 @@ func TestStepValidateTemplateShouldPassIfValidatePasses(t *testing.T) { stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) } @@ -62,7 +63,7 @@ func TestStepValidateTemplateShouldTakeStepArgumentsFromStateBag(t *testing.T) { } stateBag := createTestStateBagStepValidateTemplate() - var result = testSubject.Run(stateBag) + var result = testSubject.Run(context.Background(), stateBag) if result != multistep.ActionContinue { t.Fatalf("Expected the step to return 'ActionContinue', but got '%d'.", result) diff --git a/builder/docker/step_commit_test.go b/builder/docker/step_commit_test.go index ff2db0ad7..16548b069 100644 --- a/builder/docker/step_commit_test.go +++ b/builder/docker/step_commit_test.go @@ -1,6 +1,7 @@ package docker import ( + "context" "errors" "testing" @@ -26,7 +27,7 @@ func TestStepCommit(t *testing.T) { driver.CommitImageId = "bar" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -56,7 +57,7 @@ func TestStepCommit_error(t *testing.T) { driver.CommitErr = errors.New("foo") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/docker/step_export_test.go b/builder/docker/step_export_test.go index 1b1221e62..aa3fd124b 100644 --- a/builder/docker/step_export_test.go +++ b/builder/docker/step_export_test.go @@ -2,6 +2,7 @@ package docker import ( "bytes" + "context" "errors" "io/ioutil" "os" @@ -39,7 +40,7 @@ func TestStepExport(t *testing.T) { driver.ExportReader = bytes.NewReader([]byte("data!")) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -84,7 +85,7 @@ func TestStepExport_error(t *testing.T) { driver.ExportError = errors.New("foo") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/docker/step_pull_test.go b/builder/docker/step_pull_test.go index 9b8ed1d1b..b01b42107 100644 --- a/builder/docker/step_pull_test.go +++ b/builder/docker/step_pull_test.go @@ -1,6 +1,7 @@ package docker import ( + "context" "errors" "testing" @@ -20,7 +21,7 @@ func TestStepPull(t *testing.T) { driver := state.Get("driver").(*MockDriver) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -42,7 +43,7 @@ func TestStepPull_error(t *testing.T) { driver.PullError = errors.New("foo") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -63,7 +64,7 @@ func TestStepPull_login(t *testing.T) { config.Login = true // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -92,7 +93,7 @@ func TestStepPull_noPull(t *testing.T) { driver := state.Get("driver").(*MockDriver) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/docker/step_run_test.go b/builder/docker/step_run_test.go index 9993cb357..bc6639319 100644 --- a/builder/docker/step_run_test.go +++ b/builder/docker/step_run_test.go @@ -18,7 +18,7 @@ func TestStepRun_impl(t *testing.T) { var _ multistep.Step = new(StepRun) } -func TestStepRun(_ context.Context, t *testing.T) { +func TestStepRun(t *testing.T) { state := testStepRunState(t) step := new(StepRun) defer step.Cleanup(state) @@ -28,7 +28,7 @@ func TestStepRun(_ context.Context, t *testing.T) { driver.StartID = "foo" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -75,7 +75,7 @@ func TestStepRun_error(t *testing.T) { driver.StartError = errors.New("foo") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/docker/step_temp_dir_test.go b/builder/docker/step_temp_dir_test.go index 68c8d0455..e36d4fcff 100644 --- a/builder/docker/step_temp_dir_test.go +++ b/builder/docker/step_temp_dir_test.go @@ -1,6 +1,7 @@ package docker import ( + "context" "os" "path/filepath" "testing" @@ -24,7 +25,7 @@ func testStepTempDir_impl(t *testing.T) string { } // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_check_existing_image_test.go b/builder/googlecompute/step_check_existing_image_test.go index 1c499e743..d4b9a9541 100644 --- a/builder/googlecompute/step_check_existing_image_test.go +++ b/builder/googlecompute/step_check_existing_image_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -22,7 +23,7 @@ func TestStepCheckExistingImage(t *testing.T) { driver.ImageExistsResult = true // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_create_image_test.go b/builder/googlecompute/step_create_image_test.go index e920e03f2..6f1121a9f 100644 --- a/builder/googlecompute/step_create_image_test.go +++ b/builder/googlecompute/step_create_image_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "testing" @@ -26,7 +27,7 @@ func TestStepCreateImage(t *testing.T) { d.CreateImageResultSizeGb = 100 // run the step - action := step.Run(state) + action := step.Run(context.Background(), state) assert.Equal(t, action, multistep.ActionContinue, "Step did not pass.") uncastImage, ok := state.GetOk("image") @@ -61,7 +62,7 @@ func TestStepCreateImage_errorOnChannel(t *testing.T) { driver.CreateImageErrCh = errCh // run the step - action := step.Run(state) + action := step.Run(context.Background(), state) assert.Equal(t, action, multistep.ActionHalt, "Step should not have passed.") _, ok := state.GetOk("error") assert.True(t, ok, "State should have an error.") diff --git a/builder/googlecompute/step_create_instance_test.go b/builder/googlecompute/step_create_instance_test.go index 5a497a78e..f8196e3d0 100644 --- a/builder/googlecompute/step_create_instance_test.go +++ b/builder/googlecompute/step_create_instance_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "strings" "testing" @@ -26,7 +27,7 @@ func TestStepCreateInstance(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100) // run the step - assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.") // Verify state nameRaw, ok := state.GetOk("instance_name") @@ -67,7 +68,7 @@ func TestStepCreateInstance_fromFamily(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100) // run the step - assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.") // cleanup step.Cleanup(state) @@ -93,7 +94,7 @@ func TestStepCreateInstance_windowsNeedsPassword(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{"windows"}, 100) c.Comm.Type = "winrm" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -142,7 +143,7 @@ func TestStepCreateInstance_windowsPasswordSet(t *testing.T) { config.Comm.WinRMPassword = "password" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -188,7 +189,7 @@ func TestStepCreateInstance_error(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100) // run the step - assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.") // Verify state _, ok := state.GetOk("error") @@ -212,7 +213,7 @@ func TestStepCreateInstance_errorOnChannel(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100) // run the step - assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.") // Verify state _, ok := state.GetOk("error") @@ -238,7 +239,7 @@ func TestStepCreateInstance_errorTimeout(t *testing.T) { d.GetImageResult = StubImage("test-image", "test-project", []string{}, 100) // run the step - assert.Equal(t, step.Run(state), multistep.ActionHalt, "Step should have failed and halted.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionHalt, "Step should have failed and halted.") // Verify state _, ok := state.GetOk("error") diff --git a/builder/googlecompute/step_create_ssh_key_test.go b/builder/googlecompute/step_create_ssh_key_test.go index 31481e8b6..bc1b2e6b5 100644 --- a/builder/googlecompute/step_create_ssh_key_test.go +++ b/builder/googlecompute/step_create_ssh_key_test.go @@ -1,6 +1,8 @@ package googlecompute import ( + "context" + "github.com/hashicorp/packer/helper/multistep" "io/ioutil" @@ -19,7 +21,7 @@ func TestStepCreateSSHKey_privateKey(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -35,7 +37,7 @@ func TestStepCreateSSHKey(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -63,7 +65,7 @@ func TestStepCreateSSHKey_debug(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_create_windows_password_test.go b/builder/googlecompute/step_create_windows_password_test.go index 2b0050b1d..3a58d4816 100644 --- a/builder/googlecompute/step_create_windows_password_test.go +++ b/builder/googlecompute/step_create_windows_password_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "io/ioutil" "os" @@ -21,7 +22,7 @@ func TestStepCreateOrResetWindowsPassword(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -44,7 +45,7 @@ func TestStepCreateOrResetWindowsPassword_passwordSet(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -63,7 +64,7 @@ func TestStepCreateOrResetWindowsPassword_dontNeedPassword(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -89,7 +90,7 @@ func TestStepCreateOrResetWindowsPassword_debug(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -116,7 +117,7 @@ func TestStepCreateOrResetWindowsPassword_error(t *testing.T) { driver.CreateOrResetWindowsPasswordErr = errors.New("error") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -148,7 +149,7 @@ func TestStepCreateOrResetWindowsPassword_errorOnChannel(t *testing.T) { driver.CreateOrResetWindowsPasswordErrCh = errCh // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_instance_info_test.go b/builder/googlecompute/step_instance_info_test.go index 3918a009e..86f718369 100644 --- a/builder/googlecompute/step_instance_info_test.go +++ b/builder/googlecompute/step_instance_info_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "errors" "testing" "time" @@ -24,7 +25,7 @@ func TestStepInstanceInfo(t *testing.T) { driver.GetNatIPResult = "1.2.3.4" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -64,7 +65,7 @@ func TestStepInstanceInfo_InternalIP(t *testing.T) { driver.GetInternalIPResult = "5.6.7.8" // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -101,7 +102,7 @@ func TestStepInstanceInfo_getNatIPError(t *testing.T) { driver.GetNatIPErr = errors.New("error") // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -128,7 +129,7 @@ func TestStepInstanceInfo_waitError(t *testing.T) { driver.WaitForInstanceErrCh = errCh // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -161,7 +162,7 @@ func TestStepInstanceInfo_errorTimeout(t *testing.T) { driver.WaitForInstanceErrCh = errCh // run the step - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_teardown_instance_test.go b/builder/googlecompute/step_teardown_instance_test.go index f19dac960..129c4e596 100644 --- a/builder/googlecompute/step_teardown_instance_test.go +++ b/builder/googlecompute/step_teardown_instance_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -19,7 +20,7 @@ func TestStepTeardownInstance(t *testing.T) { driver := state.Get("driver").(*DriverMock) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/googlecompute/step_wait_startup_script_test.go b/builder/googlecompute/step_wait_startup_script_test.go index 51643eb2d..a970dc48d 100644 --- a/builder/googlecompute/step_wait_startup_script_test.go +++ b/builder/googlecompute/step_wait_startup_script_test.go @@ -1,6 +1,7 @@ package googlecompute import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -23,7 +24,7 @@ func TestStepWaitStartupScript(t *testing.T) { d.GetInstanceMetadataResult = StartupScriptStatusDone // Run the step. - assert.Equal(t, step.Run(state), multistep.ActionContinue, "Step should have passed and continued.") + assert.Equal(t, step.Run(context.Background(), state), multistep.ActionContinue, "Step should have passed and continued.") // Check that GetInstanceMetadata was called properly. assert.Equal(t, d.GetInstanceMetadataZone, testZone, "Incorrect zone passed to GetInstanceMetadata.") diff --git a/builder/hyperv/iso/builder_test.go b/builder/hyperv/iso/builder_test.go index fa164d85f..b08a683f9 100644 --- a/builder/hyperv/iso/builder_test.go +++ b/builder/hyperv/iso/builder_test.go @@ -1,6 +1,7 @@ package iso import ( + "context" "fmt" "reflect" "strconv" @@ -513,7 +514,7 @@ func TestUserVariablesInBootCommand(t *testing.T) { Ctx: b.config.ctx, } - ret := step.Run(state) + ret := step.Run(context.Background(), state) if ret != multistep.ActionContinue { t.Fatalf("should not have error: %#v", ret) } diff --git a/builder/hyperv/vmcx/builder_test.go b/builder/hyperv/vmcx/builder_test.go index e428672c6..08444c26d 100644 --- a/builder/hyperv/vmcx/builder_test.go +++ b/builder/hyperv/vmcx/builder_test.go @@ -1,6 +1,7 @@ package vmcx import ( + "context" "fmt" "reflect" "testing" @@ -534,7 +535,7 @@ func TestUserVariablesInBootCommand(t *testing.T) { Ctx: b.config.ctx, } - ret := step.Run(state) + ret := step.Run(context.Background(), state) if ret != multistep.ActionContinue { t.Fatalf("should not have error: %#v", ret) } diff --git a/builder/oracle/oci/step_create_instance_test.go b/builder/oracle/oci/step_create_instance_test.go index 3594281b6..6ab2ceb67 100644 --- a/builder/oracle/oci/step_create_instance_test.go +++ b/builder/oracle/oci/step_create_instance_test.go @@ -1,6 +1,7 @@ package oci import ( + "context" "errors" "testing" @@ -16,7 +17,7 @@ func TestStepCreateInstance(t *testing.T) { driver := state.Get("driver").(*driverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -44,7 +45,7 @@ func TestStepCreateInstance_CreateInstanceErr(t *testing.T) { driver := state.Get("driver").(*driverMock) driver.CreateInstanceErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -73,7 +74,7 @@ func TestStepCreateInstance_WaitForInstanceStateErr(t *testing.T) { driver := state.Get("driver").(*driverMock) driver.WaitForInstanceStateErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -91,7 +92,7 @@ func TestStepCreateInstance_TerminateInstanceErr(t *testing.T) { driver := state.Get("driver").(*driverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -117,7 +118,7 @@ func TestStepCreateInstanceCleanup_WaitForInstanceStateErr(t *testing.T) { driver := state.Get("driver").(*driverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/oracle/oci/step_image_test.go b/builder/oracle/oci/step_image_test.go index e3e0e353c..955d557a9 100644 --- a/builder/oracle/oci/step_image_test.go +++ b/builder/oracle/oci/step_image_test.go @@ -1,6 +1,7 @@ package oci import ( + "context" "errors" "testing" @@ -14,7 +15,7 @@ func TestStepImage(t *testing.T) { step := new(stepImage) defer step.Cleanup(state) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -33,7 +34,7 @@ func TestStepImage_CreateImageErr(t *testing.T) { driver := state.Get("driver").(*driverMock) driver.CreateImageErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -56,7 +57,7 @@ func TestStepImage_WaitForImageCreationErr(t *testing.T) { driver := state.Get("driver").(*driverMock) driver.WaitForImageCreationErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/oracle/oci/step_instance_info_test.go b/builder/oracle/oci/step_instance_info_test.go index 6280e3e6f..7117ec44a 100644 --- a/builder/oracle/oci/step_instance_info_test.go +++ b/builder/oracle/oci/step_instance_info_test.go @@ -1,6 +1,7 @@ package oci import ( + "context" "errors" "testing" @@ -14,7 +15,7 @@ func TestInstanceInfo(t *testing.T) { step := new(stepInstanceInfo) defer step.Cleanup(state) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -38,7 +39,7 @@ func TestInstanceInfo_GetInstanceIPErr(t *testing.T) { driver := state.Get("driver").(*driverMock) driver.GetInstanceIPErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/parallels/common/step_attach_floppy_test.go b/builder/parallels/common/step_attach_floppy_test.go index 7df1c4569..2d951cf05 100644 --- a/builder/parallels/common/step_attach_floppy_test.go +++ b/builder/parallels/common/step_attach_floppy_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -30,7 +31,7 @@ func TestStepAttachFloppy(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -72,7 +73,7 @@ func TestStepAttachFloppy_noFloppy(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/parallels/common/step_compact_disk_test.go b/builder/parallels/common/step_compact_disk_test.go index 4b41c5f41..e32ef217b 100644 --- a/builder/parallels/common/step_compact_disk_test.go +++ b/builder/parallels/common/step_compact_disk_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -31,7 +32,7 @@ func TestStepCompactDisk(t *testing.T) { driver.DiskPathResult = tf.Name() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -59,7 +60,7 @@ func TestStepCompactDisk_skip(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/parallels/common/step_output_dir_test.go b/builder/parallels/common/step_output_dir_test.go index 3f6d83436..17d441457 100644 --- a/builder/parallels/common/step_output_dir_test.go +++ b/builder/parallels/common/step_output_dir_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -29,7 +30,7 @@ func TestStepOutputDir(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -51,7 +52,7 @@ func TestStepOutputDir_cancelled(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -76,7 +77,7 @@ func TestStepOutputDir_halted(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/parallels/common/step_prepare_parallels_tools_test.go b/builder/parallels/common/step_prepare_parallels_tools_test.go index f0542c41d..4f46fc642 100644 --- a/builder/parallels/common/step_prepare_parallels_tools_test.go +++ b/builder/parallels/common/step_prepare_parallels_tools_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -32,7 +33,7 @@ func TestStepPrepareParallelsTools(t *testing.T) { driver.ToolsISOPathResult = tf.Name() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -67,7 +68,7 @@ func TestStepPrepareParallelsTools_disabled(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -93,7 +94,7 @@ func TestStepPrepareParallelsTools_nonExist(t *testing.T) { driver.ToolsISOPathResult = "foo" // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { diff --git a/builder/parallels/common/step_shutdown_test.go b/builder/parallels/common/step_shutdown_test.go index ef8dea7e0..0d137431f 100644 --- a/builder/parallels/common/step_shutdown_test.go +++ b/builder/parallels/common/step_shutdown_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "time" @@ -23,7 +24,7 @@ func TestStepShutdown_noShutdownCommand(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -60,7 +61,7 @@ func TestStepShutdown_shutdownCommand(t *testing.T) { }() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -97,7 +98,7 @@ func TestStepShutdown_shutdownTimeout(t *testing.T) { }() // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { diff --git a/builder/parallels/common/step_type_boot_command_test.go b/builder/parallels/common/step_type_boot_command_test.go index 559241c60..72b5056b4 100644 --- a/builder/parallels/common/step_type_boot_command_test.go +++ b/builder/parallels/common/step_type_boot_command_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "strings" "testing" @@ -38,7 +39,7 @@ func TestStepTypeBootCommand(t *testing.T) { state.Put("http_port", uint(0)) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/parallels/common/step_upload_parallels_tools_test.go b/builder/parallels/common/step_upload_parallels_tools_test.go index 7e2f92110..aeff516d3 100644 --- a/builder/parallels/common/step_upload_parallels_tools_test.go +++ b/builder/parallels/common/step_upload_parallels_tools_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -23,7 +24,7 @@ func TestStepUploadParallelsTools(t *testing.T) { state.Put("communicator", comm) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -48,7 +49,7 @@ func TestStepUploadParallelsTools_interpolate(t *testing.T) { state.Put("communicator", comm) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -73,7 +74,7 @@ func TestStepUploadParallelsTools_attach(t *testing.T) { state.Put("communicator", comm) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/parallels/common/step_upload_version_test.go b/builder/parallels/common/step_upload_version_test.go index 17609b9aa..998d35f0e 100644 --- a/builder/parallels/common/step_upload_version_test.go +++ b/builder/parallels/common/step_upload_version_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -23,7 +24,7 @@ func TestStepUploadVersion(t *testing.T) { driver.VersionResult = "foo" // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -48,7 +49,7 @@ func TestStepUploadVersion_noPath(t *testing.T) { state.Put("communicator", comm) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/triton/step_create_image_from_machine_test.go b/builder/triton/step_create_image_from_machine_test.go index 9af18e44f..34eb95c8c 100644 --- a/builder/triton/step_create_image_from_machine_test.go +++ b/builder/triton/step_create_image_from_machine_test.go @@ -1,6 +1,7 @@ package triton import ( + "context" "errors" "testing" @@ -14,7 +15,7 @@ func TestStepCreateImageFromMachine(t *testing.T) { state.Put("machine", "test-machine-id") - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -36,7 +37,7 @@ func TestStepCreateImageFromMachine_CreateImageFromMachineError(t *testing.T) { driver.CreateImageFromMachineErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -59,7 +60,7 @@ func TestStepCreateImageFromMachine_WaitForImageCreationError(t *testing.T) { driver.WaitForImageCreationErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/triton/step_create_source_machine_test.go b/builder/triton/step_create_source_machine_test.go index f7101564a..78d97ad5e 100644 --- a/builder/triton/step_create_source_machine_test.go +++ b/builder/triton/step_create_source_machine_test.go @@ -1,6 +1,7 @@ package triton import ( + "context" "errors" "testing" @@ -14,7 +15,7 @@ func TestStepCreateSourceMachine(t *testing.T) { driver := state.Get("driver").(*DriverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -39,7 +40,7 @@ func TestStepCreateSourceMachine_CreateMachineError(t *testing.T) { driver.CreateMachineErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -61,7 +62,7 @@ func TestStepCreateSourceMachine_WaitForMachineStateError(t *testing.T) { driver.WaitForMachineStateErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -81,7 +82,7 @@ func TestStepCreateSourceMachine_StopMachineError(t *testing.T) { driver := state.Get("driver").(*DriverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -109,7 +110,7 @@ func TestStepCreateSourceMachine_WaitForMachineStoppedError(t *testing.T) { driver := state.Get("driver").(*DriverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -137,7 +138,7 @@ func TestStepCreateSourceMachine_DeleteMachineError(t *testing.T) { driver := state.Get("driver").(*DriverMock) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } diff --git a/builder/triton/step_delete_machine_test.go b/builder/triton/step_delete_machine_test.go index a2177ca36..421024d58 100644 --- a/builder/triton/step_delete_machine_test.go +++ b/builder/triton/step_delete_machine_test.go @@ -1,6 +1,7 @@ package triton import ( + "context" "errors" "testing" @@ -17,7 +18,7 @@ func TestStepDeleteMachine(t *testing.T) { machineId := "test-machine-id" state.Put("machine", machineId) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -40,7 +41,7 @@ func TestStepDeleteMachine_DeleteMachineError(t *testing.T) { driver.DeleteMachineErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -65,7 +66,7 @@ func TestStepDeleteMachine_WaitForMachineDeletionError(t *testing.T) { driver.WaitForMachineDeletionErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/triton/step_stop_machine_test.go b/builder/triton/step_stop_machine_test.go index 9604c2216..8f0f39d2d 100644 --- a/builder/triton/step_stop_machine_test.go +++ b/builder/triton/step_stop_machine_test.go @@ -1,6 +1,7 @@ package triton import ( + "context" "errors" "testing" @@ -17,7 +18,7 @@ func TestStepStopMachine(t *testing.T) { machineId := "test-machine-id" state.Put("machine", machineId) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } @@ -40,7 +41,7 @@ func TestStepStopMachine_StopMachineError(t *testing.T) { driver.StopMachineErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } @@ -61,7 +62,7 @@ func TestStepStopMachine_WaitForMachineStoppedError(t *testing.T) { driver.WaitForMachineStateErr = errors.New("error") - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } diff --git a/builder/virtualbox/common/step_attach_floppy_test.go b/builder/virtualbox/common/step_attach_floppy_test.go index 9dba8adf1..32ad4a962 100644 --- a/builder/virtualbox/common/step_attach_floppy_test.go +++ b/builder/virtualbox/common/step_attach_floppy_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -30,7 +31,7 @@ func TestStepAttachFloppy(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -61,7 +62,7 @@ func TestStepAttachFloppy_noFloppy(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/virtualbox/common/step_export_test.go b/builder/virtualbox/common/step_export_test.go index 1bea8df57..6d37b3150 100644 --- a/builder/virtualbox/common/step_export_test.go +++ b/builder/virtualbox/common/step_export_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -19,7 +20,7 @@ func TestStepExport(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/virtualbox/common/step_output_dir_test.go b/builder/virtualbox/common/step_output_dir_test.go index 5066e0e56..1e2f05c84 100644 --- a/builder/virtualbox/common/step_output_dir_test.go +++ b/builder/virtualbox/common/step_output_dir_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -29,7 +30,7 @@ func TestStepOutputDir(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -56,7 +57,7 @@ func TestStepOutputDir_exists(t *testing.T) { } // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { @@ -75,7 +76,7 @@ func TestStepOutputDir_cancelled(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -100,7 +101,7 @@ func TestStepOutputDir_halted(t *testing.T) { step := testStepOutputDir(t) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/virtualbox/common/step_remove_devices_test.go b/builder/virtualbox/common/step_remove_devices_test.go index 0d9f6bbe9..0a548bbd2 100644 --- a/builder/virtualbox/common/step_remove_devices_test.go +++ b/builder/virtualbox/common/step_remove_devices_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -19,7 +20,7 @@ func TestStepRemoveDevices(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -42,7 +43,7 @@ func TestStepRemoveDevices_attachedIso(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -69,7 +70,7 @@ func TestStepRemoveDevices_attachedIsoOnSata(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -95,7 +96,7 @@ func TestStepRemoveDevices_floppyPath(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/virtualbox/common/step_shutdown_test.go b/builder/virtualbox/common/step_shutdown_test.go index d38b3378c..44bd1d927 100644 --- a/builder/virtualbox/common/step_shutdown_test.go +++ b/builder/virtualbox/common/step_shutdown_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "time" @@ -23,7 +24,7 @@ func TestStepShutdown_noShutdownCommand(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -60,7 +61,7 @@ func TestStepShutdown_shutdownCommand(t *testing.T) { }() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -97,7 +98,7 @@ func TestStepShutdown_shutdownTimeout(t *testing.T) { }() // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { @@ -129,7 +130,7 @@ func TestStepShutdown_shutdownDelay(t *testing.T) { // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } testDuration := time.Since(start).Seconds() @@ -154,7 +155,7 @@ func TestStepShutdown_shutdownDelay(t *testing.T) { }() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } testDuration = time.Since(start).Seconds() diff --git a/builder/virtualbox/common/step_suppress_messages_test.go b/builder/virtualbox/common/step_suppress_messages_test.go index ad3a59fd7..c37af7826 100644 --- a/builder/virtualbox/common/step_suppress_messages_test.go +++ b/builder/virtualbox/common/step_suppress_messages_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "errors" "testing" @@ -18,7 +19,7 @@ func TestStepSuppressMessages(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -38,7 +39,7 @@ func TestStepSuppressMessages_error(t *testing.T) { driver.SuppressMessagesErr = errors.New("foo") // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { diff --git a/builder/virtualbox/common/step_upload_version_test.go b/builder/virtualbox/common/step_upload_version_test.go index 17609b9aa..998d35f0e 100644 --- a/builder/virtualbox/common/step_upload_version_test.go +++ b/builder/virtualbox/common/step_upload_version_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -23,7 +24,7 @@ func TestStepUploadVersion(t *testing.T) { driver.VersionResult = "foo" // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -48,7 +49,7 @@ func TestStepUploadVersion_noPath(t *testing.T) { state.Put("communicator", comm) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/virtualbox/ovf/step_import_test.go b/builder/virtualbox/ovf/step_import_test.go index 45054585c..ffaecc0ba 100644 --- a/builder/virtualbox/ovf/step_import_test.go +++ b/builder/virtualbox/ovf/step_import_test.go @@ -1,6 +1,7 @@ package ovf import ( + "context" "testing" vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common" @@ -23,7 +24,7 @@ func TestStepImport(t *testing.T) { driver := state.Get("driver").(*vboxcommon.DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_clean_vmx_test.go b/builder/vmware/common/step_clean_vmx_test.go index 04b2da1f5..0f4df3df2 100644 --- a/builder/vmware/common/step_clean_vmx_test.go +++ b/builder/vmware/common/step_clean_vmx_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -21,7 +22,7 @@ func TestStepCleanVMX(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -42,7 +43,7 @@ func TestStepCleanVMX_floppyPath(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -91,7 +92,7 @@ func TestStepCleanVMX_isoPath(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -143,7 +144,7 @@ func TestStepCleanVMX_ethernet(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_compact_disk_test.go b/builder/vmware/common/step_compact_disk_test.go index 982191a4d..365e9ccb2 100644 --- a/builder/vmware/common/step_compact_disk_test.go +++ b/builder/vmware/common/step_compact_disk_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -19,7 +20,7 @@ func TestStepCompactDisk(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -45,7 +46,7 @@ func TestStepCompactDisk_skip(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_configure_vmx_test.go b/builder/vmware/common/step_configure_vmx_test.go index 6bd692caa..c5e242a51 100644 --- a/builder/vmware/common/step_configure_vmx_test.go +++ b/builder/vmware/common/step_configure_vmx_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -34,7 +35,7 @@ func TestStepConfigureVMX(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -87,7 +88,7 @@ func TestStepConfigureVMX_floppyPath(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -144,7 +145,7 @@ func TestStepConfigureVMX_generatedAddresses(t *testing.T) { state.Put("vmx_path", vmxPath) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_output_dir_test.go b/builder/vmware/common/step_output_dir_test.go index dd1326387..fe71bbea8 100644 --- a/builder/vmware/common/step_output_dir_test.go +++ b/builder/vmware/common/step_output_dir_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -32,7 +33,7 @@ func TestStepOutputDir(t *testing.T) { state.Put("dir", dir) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -62,7 +63,7 @@ func TestStepOutputDir_existsNoForce(t *testing.T) { } // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { @@ -90,7 +91,7 @@ func TestStepOutputDir_existsForce(t *testing.T) { } // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -109,7 +110,7 @@ func TestStepOutputDir_cancel(t *testing.T) { state.Put("dir", dir) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -135,7 +136,7 @@ func TestStepOutputDir_halt(t *testing.T) { state.Put("dir", dir) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_prepare_tools_test.go b/builder/vmware/common/step_prepare_tools_test.go index 3ef593e5f..cddf0ffba 100644 --- a/builder/vmware/common/step_prepare_tools_test.go +++ b/builder/vmware/common/step_prepare_tools_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "testing" @@ -32,7 +33,7 @@ func TestStepPrepareTools(t *testing.T) { driver.ToolsIsoPathResult = tf.Name() // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -67,7 +68,7 @@ func TestStepPrepareTools_esx5(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -93,7 +94,7 @@ func TestStepPrepareTools_nonExist(t *testing.T) { driver.ToolsIsoPathResult = "foo" // Test the run - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { diff --git a/builder/vmware/common/step_run_test.go b/builder/vmware/common/step_run_test.go index b884351dd..e89dcb1cf 100644 --- a/builder/vmware/common/step_run_test.go +++ b/builder/vmware/common/step_run_test.go @@ -11,7 +11,7 @@ func TestStepRun_impl(t *testing.T) { var _ multistep.Step = new(StepRun) } -func TestStepRun(_ context.Context, t *testing.T) { +func TestStepRun(t *testing.T) { state := testState(t) step := new(StepRun) @@ -20,7 +20,7 @@ func TestStepRun(_ context.Context, t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -54,7 +54,7 @@ func TestStepRun_cleanupRunning(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/common/step_shutdown_test.go b/builder/vmware/common/step_shutdown_test.go index dd4693348..ed0eae486 100644 --- a/builder/vmware/common/step_shutdown_test.go +++ b/builder/vmware/common/step_shutdown_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "io/ioutil" "os" "path/filepath" @@ -49,7 +50,7 @@ func TestStepShutdown_command(t *testing.T) { resultCh := make(chan multistep.StepAction, 1) go func() { - resultCh <- step.Run(state) + resultCh <- step.Run(context.Background(), state) }() select { @@ -94,7 +95,7 @@ func TestStepShutdown_noCommand(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -138,7 +139,7 @@ func TestStepShutdown_locks(t *testing.T) { resultCh := make(chan multistep.StepAction, 1) go func() { - resultCh <- step.Run(state) + resultCh <- step.Run(context.Background(), state) }() select { diff --git a/builder/vmware/common/step_suppress_messages_test.go b/builder/vmware/common/step_suppress_messages_test.go index a76b365a3..24044d470 100644 --- a/builder/vmware/common/step_suppress_messages_test.go +++ b/builder/vmware/common/step_suppress_messages_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -19,7 +20,7 @@ func TestStepSuppressMessages(t *testing.T) { driver := state.Get("driver").(*DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/iso/step_export_test.go b/builder/vmware/iso/step_export_test.go index c41b2550b..27c2a0c36 100644 --- a/builder/vmware/iso/step_export_test.go +++ b/builder/vmware/iso/step_export_test.go @@ -1,6 +1,7 @@ package iso import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -18,7 +19,7 @@ func testStepExport_wrongtype_impl(t *testing.T, remoteType string) { config.RemoteType = "foo" state.Put("config", &config) - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/iso/step_register_test.go b/builder/vmware/iso/step_register_test.go index 0d2aaaa97..099e067ab 100644 --- a/builder/vmware/iso/step_register_test.go +++ b/builder/vmware/iso/step_register_test.go @@ -1,6 +1,7 @@ package iso import ( + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -17,7 +18,7 @@ func TestStepRegister_regularDriver(t *testing.T) { state.Put("vmx_path", "foo") // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -41,7 +42,7 @@ func TestStepRegister_remoteDriver(t *testing.T) { state.Put("vmx_path", "foo") // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { @@ -81,7 +82,7 @@ func TestStepRegister_WithoutUnregister_remoteDriver(t *testing.T) { state.Put("vmx_path", "foo") // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/builder/vmware/vmx/step_clone_vmx_test.go b/builder/vmware/vmx/step_clone_vmx_test.go index 0fedd84c8..e086f0ce5 100644 --- a/builder/vmware/vmx/step_clone_vmx_test.go +++ b/builder/vmware/vmx/step_clone_vmx_test.go @@ -1,6 +1,7 @@ package vmx import ( + "context" "io/ioutil" "os" "path/filepath" @@ -43,7 +44,7 @@ func TestStepCloneVMX(t *testing.T) { driver := state.Get("driver").(*vmwcommon.DriverMock) // Test the run - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { diff --git a/common/step_create_floppy_test.go b/common/step_create_floppy_test.go index 2128e4dd7..4c43a6839 100644 --- a/common/step_create_floppy_test.go +++ b/common/step_create_floppy_test.go @@ -2,6 +2,7 @@ package common import ( "bytes" + "context" "fmt" "io/ioutil" "log" @@ -89,7 +90,7 @@ func TestStepCreateFloppy(t *testing.T) { } for _, step.Files = range lists { - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v", action, step.Files) } @@ -140,7 +141,7 @@ func xxxTestStepCreateFloppy_missing(t *testing.T) { } for _, step.Files = range lists { - if action := step.Run(state); action != multistep.ActionHalt { + if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v for %v", action, step.Files) } @@ -190,7 +191,7 @@ func xxxTestStepCreateFloppy_notfound(t *testing.T) { } for _, step.Files = range lists { - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v", action, step.Files) } @@ -265,7 +266,7 @@ func TestStepCreateFloppyDirectories(t *testing.T) { log.Println(fmt.Sprintf("Trying against floppy_dirs : %v", step.Directories)) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v : %v", action, step.Directories, state.Get("error")) } diff --git a/helper/communicator/step_connect_test.go b/helper/communicator/step_connect_test.go index aa51e1782..fb61f6463 100644 --- a/helper/communicator/step_connect_test.go +++ b/helper/communicator/step_connect_test.go @@ -2,6 +2,7 @@ package communicator import ( "bytes" + "context" "testing" "github.com/hashicorp/packer/helper/multistep" @@ -23,7 +24,7 @@ func TestStepConnect_none(t *testing.T) { defer step.Cleanup(state) // run the step - if action := step.Run(state); action != multistep.ActionContinue { + if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } } From ce4f30c5ae36013d797f5b18a6b3e03f01931f26 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 16:50:14 -0800 Subject: [PATCH 14/19] fix tests --- helper/multistep/basic_runner_test.go | 14 ++++++-------- helper/multistep/debug_runner.go | 2 +- helper/multistep/debug_runner_test.go | 12 +++++------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/helper/multistep/basic_runner_test.go b/helper/multistep/basic_runner_test.go index d13ccedf0..433f288d2 100644 --- a/helper/multistep/basic_runner_test.go +++ b/helper/multistep/basic_runner_test.go @@ -4,8 +4,6 @@ import ( "reflect" "testing" "time" - - "golang.org/x/net/context" ) func TestBasicRunner_ImplRunner(t *testing.T) { @@ -22,7 +20,7 @@ func TestBasicRunner_Run(t *testing.T) { stepB := &TestStepAcc{Data: "b"} r := &BasicRunner{Steps: []Step{stepA, stepB}} - r.Run(context.Background(), data) + r.Run(data) // Test run data expected := []string{"a", "b"} @@ -55,7 +53,7 @@ func TestBasicRunner_Run_Halt(t *testing.T) { stepC := &TestStepAcc{Data: "c"} r := &BasicRunner{Steps: []Step{stepA, stepB, stepC}} - r.Run(context.Background(), data) + r.Run(data) // Test run data expected := []string{"a", "b"} @@ -88,12 +86,12 @@ func TestBasicRunner_Run_Run(t *testing.T) { stepWait := &TestStepWaitForever{} r := &BasicRunner{Steps: []Step{stepInt, stepWait}} - go r.Run(context.Background(), new(BasicStateBag)) + go r.Run(new(BasicStateBag)) // wait until really running <-ch // now try to run aain - r.Run(context.Background(), new(BasicStateBag)) + r.Run(new(BasicStateBag)) // should not get here in nominal codepath t.Errorf("Was able to run an already running BasicRunner") @@ -112,7 +110,7 @@ func TestBasicRunner_Cancel(t *testing.T) { // cancelling an idle Runner is a no-op r.Cancel() - go r.Run(context.Background(), data) + go r.Run(data) // Wait until we reach the sync point responseCh := <-ch @@ -163,7 +161,7 @@ func TestBasicRunner_Cancel_Special(t *testing.T) { state := new(BasicStateBag) state.Put("runner", r) - r.Run(context.Background(), state) + r.Run(state) // test that state contains cancelled if _, ok := state.GetOk(StateCancelled); !ok { diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 88af01c54..83dbe57e2 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,8 +1,8 @@ package multistep import ( - "context" "fmt" + "golang.org/x/net/context" "reflect" "sync" ) diff --git a/helper/multistep/debug_runner_test.go b/helper/multistep/debug_runner_test.go index 78ce70a88..aae905d43 100644 --- a/helper/multistep/debug_runner_test.go +++ b/helper/multistep/debug_runner_test.go @@ -5,8 +5,6 @@ import ( "reflect" "testing" "time" - - "golang.org/x/net/context" ) func TestDebugRunner_Impl(t *testing.T) { @@ -41,7 +39,7 @@ func TestDebugRunner_Run(t *testing.T) { PauseFn: pauseFn, } - r.Run(context.Background(), data) + r.Run(data) // Test data expected := []string{"a", "TestStepAcc", "b", "TestStepAcc"} @@ -68,12 +66,12 @@ func TestDebugRunner_Run_Run(t *testing.T) { stepWait := &TestStepWaitForever{} r := &DebugRunner{Steps: []Step{stepInt, stepWait}} - go r.Run(context.Background(), new(BasicStateBag)) + go r.Run(new(BasicStateBag)) // wait until really running <-ch // now try to run aain - r.Run(context.Background(), new(BasicStateBag)) + r.Run(new(BasicStateBag)) // should not get here in nominal codepath t.Errorf("Was able to run an already running DebugRunner") @@ -93,7 +91,7 @@ func TestDebugRunner_Cancel(t *testing.T) { // cancelling an idle Runner is a no-op r.Cancel() - go r.Run(context.Background(), data) + go r.Run(data) // Wait until we reach the sync point responseCh := <-ch @@ -156,7 +154,7 @@ func TestDebugPauseDefault(t *testing.T) { dr := &DebugRunner{Steps: []Step{ &TestStepAcc{Data: "a"}, }} - dr.Run(context.Background(), new(BasicStateBag)) + dr.Run(new(BasicStateBag)) complete <- true }() From 2afd81741c0a532fa34b87e39bae5358c0509c05 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 16:55:12 -0800 Subject: [PATCH 15/19] use correct context --- helper/multistep/basic_runner.go | 3 +- helper/multistep/debug_runner.go | 2 +- helper/multistep/multistep_test.go | 2 +- vendor/golang.org/x/net/context/context.go | 447 ------------------ .../x/net/context/ctxhttp/cancelreq.go | 19 - .../x/net/context/ctxhttp/cancelreq_go14.go | 23 - .../x/net/context/ctxhttp/ctxhttp.go | 140 ------ vendor/vendor.json | 10 - 8 files changed, 3 insertions(+), 643 deletions(-) delete mode 100644 vendor/golang.org/x/net/context/context.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/cancelreq.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go delete mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go diff --git a/helper/multistep/basic_runner.go b/helper/multistep/basic_runner.go index eb5018d36..00723725d 100644 --- a/helper/multistep/basic_runner.go +++ b/helper/multistep/basic_runner.go @@ -1,10 +1,9 @@ package multistep import ( + "context" "sync" "sync/atomic" - - "golang.org/x/net/context" ) type runState int32 diff --git a/helper/multistep/debug_runner.go b/helper/multistep/debug_runner.go index 83dbe57e2..88af01c54 100644 --- a/helper/multistep/debug_runner.go +++ b/helper/multistep/debug_runner.go @@ -1,8 +1,8 @@ package multistep import ( + "context" "fmt" - "golang.org/x/net/context" "reflect" "sync" ) diff --git a/helper/multistep/multistep_test.go b/helper/multistep/multistep_test.go index b8e4a0f9e..25bbeef9b 100644 --- a/helper/multistep/multistep_test.go +++ b/helper/multistep/multistep_test.go @@ -1,6 +1,6 @@ package multistep -import "golang.org/x/net/context" +import "context" // A step for testing that accumuluates data into a string slice in the // the state bag. It always uses the "data" key in the state bag, and will diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go deleted file mode 100644 index 77b64d0c6..000000000 --- a/vendor/golang.org/x/net/context/context.go +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package context defines the Context type, which carries deadlines, -// cancelation signals, and other request-scoped values across API boundaries -// and between processes. -// -// Incoming requests to a server should create a Context, and outgoing calls to -// servers should accept a Context. The chain of function calls between must -// propagate the Context, optionally replacing it with a modified copy created -// using WithDeadline, WithTimeout, WithCancel, or WithValue. -// -// Programs that use Contexts should follow these rules to keep interfaces -// consistent across packages and enable static analysis tools to check context -// propagation: -// -// Do not store Contexts inside a struct type; instead, pass a Context -// explicitly to each function that needs it. The Context should be the first -// parameter, typically named ctx: -// -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } -// -// Do not pass a nil Context, even if a function permits it. Pass context.TODO -// if you are unsure about which Context to use. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -// -// The same Context may be passed to functions running in different goroutines; -// Contexts are safe for simultaneous use by multiple goroutines. -// -// See http://blog.golang.org/context for example code for a server that uses -// Contexts. -package context // import "golang.org/x/net/context" - -import ( - "errors" - "fmt" - "sync" - "time" -) - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - // - // WithCancel arranges for Done to be closed when cancel is called; - // WithDeadline arranges for Done to be closed when the deadline - // expires; WithTimeout arranges for Done to be closed when the timeout - // elapses. - // - // Done is provided for use in select statements: - // - // // Stream generates values with DoSomething and sends them to out - // // until DoSomething returns an error or ctx.Done is closed. - // func Stream(ctx context.Context, out <-chan Value) error { - // for { - // v, err := DoSomething(ctx) - // if err != nil { - // return err - // } - // select { - // case <-ctx.Done(): - // return ctx.Err() - // case out <- v: - // } - // } - // } - // - // See http://blog.golang.org/pipelines for more examples of how to use - // a Done channel for cancelation. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - // - // A key identifies a specific value in a Context. Functions that wish - // to store values in Context typically allocate a key in a global - // variable then use that key as the argument to context.WithValue and - // Context.Value. A key can be any type that supports equality; - // packages should define keys as an unexported type to avoid - // collisions. - // - // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: - // - // // Package user defines a User type that's stored in Contexts. - // package user - // - // import "golang.org/x/net/context" - // - // // User is the type of value stored in the Contexts. - // type User struct {...} - // - // // key is an unexported type for keys defined in this package. - // // This prevents collisions with keys defined in other packages. - // type key int - // - // // userKey is the key for user.User values in Contexts. It is - // // unexported; clients use user.NewContext and user.FromContext - // // instead of using this key directly. - // var userKey key = 0 - // - // // NewContext returns a new Context that carries value u. - // func NewContext(ctx context.Context, u *User) context.Context { - // return context.WithValue(ctx, userKey, u) - // } - // - // // FromContext returns the User value stored in ctx, if any. - // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok - // } - Value(key interface{}) interface{} -} - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = errors.New("context canceled") - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = errors.New("context deadline exceeded") - -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case background: - return "context.Background" - case todo: - return "context.TODO" - } - return "unknown empty Context" -} - -var ( - background = new(emptyCtx) - todo = new(emptyCtx) -) - -// Background returns a non-nil, empty Context. It is never canceled, has no -// values, and has no deadline. It is typically used by the main function, -// initialization, and tests, and as the top-level Context for incoming -// requests. -func Background() Context { - return background -} - -// TODO returns a non-nil, empty Context. Code should use context.TODO when -// it's unclear which Context to use or it is not yet available (because the -// surrounding function has not yet been extended to accept a Context -// parameter). TODO is recognized by static analysis tools that determine -// whether Contexts are propagated correctly in a program. -func TODO() Context { - return todo -} - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc func() - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - c := newCancelCtx(parent) - propagateCancel(parent, &c) - return &c, func() { c.cancel(true, Canceled) } -} - -// newCancelCtx returns an initialized cancelCtx. -func newCancelCtx(parent Context) cancelCtx { - return cancelCtx{ - Context: parent, - done: make(chan struct{}), - } -} - -// propagateCancel arranges for child to be canceled when parent is. -func propagateCancel(parent Context, child canceler) { - if parent.Done() == nil { - return // parent is never canceled - } - if p, ok := parentCancelCtx(parent); ok { - p.mu.Lock() - if p.err != nil { - // parent has already been canceled - child.cancel(false, p.err) - } else { - if p.children == nil { - p.children = make(map[canceler]bool) - } - p.children[child] = true - } - p.mu.Unlock() - } else { - go func() { - select { - case <-parent.Done(): - child.cancel(false, parent.Err()) - case <-child.Done(): - } - }() - } -} - -// parentCancelCtx follows a chain of parent references until it finds a -// *cancelCtx. This function understands how each of the concrete types in this -// package represents its parent. -func parentCancelCtx(parent Context) (*cancelCtx, bool) { - for { - switch c := parent.(type) { - case *cancelCtx: - return c, true - case *timerCtx: - return &c.cancelCtx, true - case *valueCtx: - parent = c.Context - default: - return nil, false - } - } -} - -// removeChild removes a context from its parent. -func removeChild(parent Context, child canceler) { - p, ok := parentCancelCtx(parent) - if !ok { - return - } - p.mu.Lock() - if p.children != nil { - delete(p.children, child) - } - p.mu.Unlock() -} - -// A canceler is a context type that can be canceled directly. The -// implementations are *cancelCtx and *timerCtx. -type canceler interface { - cancel(removeFromParent bool, err error) - Done() <-chan struct{} -} - -// A cancelCtx can be canceled. When canceled, it also cancels any children -// that implement canceler. -type cancelCtx struct { - Context - - done chan struct{} // closed by the first cancel call. - - mu sync.Mutex - children map[canceler]bool // set to nil by the first cancel call - err error // set to non-nil by the first cancel call -} - -func (c *cancelCtx) Done() <-chan struct{} { - return c.done -} - -func (c *cancelCtx) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *cancelCtx) String() string { - return fmt.Sprintf("%v.WithCancel", c.Context) -} - -// cancel closes c.done, cancels each of c's children, and, if -// removeFromParent is true, removes c from its parent's children. -func (c *cancelCtx) cancel(removeFromParent bool, err error) { - if err == nil { - panic("context: internal error: missing cancel error") - } - c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return // already canceled - } - c.err = err - close(c.done) - for child := range c.children { - // NOTE: acquiring the child's lock while holding parent's lock. - child.cancel(false, err) - } - c.children = nil - c.mu.Unlock() - - if removeFromParent { - removeChild(c.Context, c) - } -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { - // The current deadline is already sooner than the new one. - return WithCancel(parent) - } - c := &timerCtx{ - cancelCtx: newCancelCtx(parent), - deadline: deadline, - } - propagateCancel(parent, c) - d := deadline.Sub(time.Now()) - if d <= 0 { - c.cancel(true, DeadlineExceeded) // deadline has already passed - return c, func() { c.cancel(true, Canceled) } - } - c.mu.Lock() - defer c.mu.Unlock() - if c.err == nil { - c.timer = time.AfterFunc(d, func() { - c.cancel(true, DeadlineExceeded) - }) - } - return c, func() { c.cancel(true, Canceled) } -} - -// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to -// implement Done and Err. It implements cancel by stopping its timer then -// delegating to cancelCtx.cancel. -type timerCtx struct { - cancelCtx - timer *time.Timer // Under cancelCtx.mu. - - deadline time.Time -} - -func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { - return c.deadline, true -} - -func (c *timerCtx) String() string { - return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) -} - -func (c *timerCtx) cancel(removeFromParent bool, err error) { - c.cancelCtx.cancel(false, err) - if removeFromParent { - // Remove this timerCtx from its parent cancelCtx's children. - removeChild(c.cancelCtx.Context, c) - } - c.mu.Lock() - if c.timer != nil { - c.timer.Stop() - c.timer = nil - } - c.mu.Unlock() -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return &valueCtx{parent, key, val} -} - -// A valueCtx carries a key-value pair. It implements Value for that key and -// delegates all other calls to the embedded Context. -type valueCtx struct { - Context - key, val interface{} -} - -func (c *valueCtx) String() string { - return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) -} - -func (c *valueCtx) Value(key interface{}) interface{} { - if c.key == key { - return c.val - } - return c.Context.Value(key) -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go deleted file mode 100644 index e3170e333..000000000 --- a/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.5 - -package ctxhttp - -import "net/http" - -func canceler(client *http.Client, req *http.Request) func() { - // TODO(djd): Respect any existing value of req.Cancel. - ch := make(chan struct{}) - req.Cancel = ch - - return func() { - close(ch) - } -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go deleted file mode 100644 index 56bcbadb8..000000000 --- a/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.5 - -package ctxhttp - -import "net/http" - -type requestCanceler interface { - CancelRequest(*http.Request) -} - -func canceler(client *http.Client, req *http.Request) func() { - rc, ok := client.Transport.(requestCanceler) - if !ok { - return func() {} - } - return func() { - rc.CancelRequest(req) - } -} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 62620d4eb..000000000 --- a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "io" - "net/http" - "net/url" - "strings" - - "golang.org/x/net/context" -) - -func nop() {} - -var ( - testHookContextDoneBeforeHeaders = nop - testHookDoReturned = nop - testHookDidBodyClose = nop -) - -// Do sends an HTTP request with the provided http.Client and returns an HTTP response. -// If the client is nil, http.DefaultClient is used. -// If the context is canceled or times out, ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - - // Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go. - cancel := canceler(client, req) - - type responseAndError struct { - resp *http.Response - err error - } - result := make(chan responseAndError, 1) - - go func() { - resp, err := client.Do(req) - testHookDoReturned() - result <- responseAndError{resp, err} - }() - - var resp *http.Response - - select { - case <-ctx.Done(): - testHookContextDoneBeforeHeaders() - cancel() - // Clean up after the goroutine calling client.Do: - go func() { - if r := <-result; r.resp != nil { - testHookDidBodyClose() - r.resp.Body.Close() - } - }() - return nil, ctx.Err() - case r := <-result: - var err error - resp, err = r.resp, r.err - if err != nil { - return resp, err - } - } - - c := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - cancel() - case <-c: - // The response's Body is closed. - } - }() - resp.Body = ¬ifyingReader{resp.Body, c} - - return resp, nil -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} - -// notifyingReader is an io.ReadCloser that closes the notify channel after -// Close is called or a Read fails on the underlying ReadCloser. -type notifyingReader struct { - io.ReadCloser - notify chan<- struct{} -} - -func (r *notifyingReader) Read(p []byte) (int, error) { - n, err := r.ReadCloser.Read(p) - if err != nil && r.notify != nil { - close(r.notify) - r.notify = nil - } - return n, err -} - -func (r *notifyingReader) Close() error { - err := r.ReadCloser.Close() - if r.notify != nil { - close(r.notify) - r.notify = nil - } - return err -} diff --git a/vendor/vendor.json b/vendor/vendor.json index 3cf9e6714..1abbbe7b7 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1220,16 +1220,6 @@ "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", "revisionTime": "2017-02-08T20:51:15Z" }, - { - "checksumSHA1": "5ARrN3Zq+E9zazFb/N+b08Serys=", - "path": "golang.org/x/net/context", - "revision": "6ccd6698c634f5d835c40c1c31848729e0cecda1" - }, - { - "checksumSHA1": "tHFno3QaRarH85A4DV1FYuWATQI=", - "path": "golang.org/x/net/context/ctxhttp", - "revision": "6ccd6698c634f5d835c40c1c31848729e0cecda1" - }, { "checksumSHA1": "vqc3a+oTUGX8PmD0TS+qQ7gmN8I=", "path": "golang.org/x/net/html", From aa667577a57de90f8cb44a337cf5b065423438a2 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 16:59:34 -0800 Subject: [PATCH 16/19] update context library --- vendor/golang.org/x/net/context/context.go | 56 ++++ .../x/net/context/ctxhttp/ctxhttp.go | 74 +++++ .../x/net/context/ctxhttp/ctxhttp_pre17.go | 147 +++++++++ vendor/golang.org/x/net/context/go17.go | 72 +++++ vendor/golang.org/x/net/context/go19.go | 20 ++ vendor/golang.org/x/net/context/pre_go17.go | 300 ++++++++++++++++++ vendor/golang.org/x/net/context/pre_go19.go | 109 +++++++ vendor/vendor.json | 12 + 8 files changed, 790 insertions(+) create mode 100644 vendor/golang.org/x/net/context/context.go create mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go create mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go create mode 100644 vendor/golang.org/x/net/context/go17.go create mode 100644 vendor/golang.org/x/net/context/go19.go create mode 100644 vendor/golang.org/x/net/context/pre_go17.go create mode 100644 vendor/golang.org/x/net/context/pre_go19.go diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go new file mode 100644 index 000000000..a3c021d3f --- /dev/null +++ b/vendor/golang.org/x/net/context/context.go @@ -0,0 +1,56 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package context defines the Context type, which carries deadlines, +// cancelation signals, and other request-scoped values across API boundaries +// and between processes. +// As of Go 1.7 this package is available in the standard library under the +// name context. https://golang.org/pkg/context. +// +// Incoming requests to a server should create a Context, and outgoing calls to +// servers should accept a Context. The chain of function calls between must +// propagate the Context, optionally replacing it with a modified copy created +// using WithDeadline, WithTimeout, WithCancel, or WithValue. +// +// Programs that use Contexts should follow these rules to keep interfaces +// consistent across packages and enable static analysis tools to check context +// propagation: +// +// Do not store Contexts inside a struct type; instead, pass a Context +// explicitly to each function that needs it. The Context should be the first +// parameter, typically named ctx: +// +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } +// +// Do not pass a nil Context, even if a function permits it. Pass context.TODO +// if you are unsure about which Context to use. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +// +// The same Context may be passed to functions running in different goroutines; +// Contexts are safe for simultaneous use by multiple goroutines. +// +// See http://blog.golang.org/context for example code for a server that uses +// Contexts. +package context // import "golang.org/x/net/context" + +// Background returns a non-nil, empty Context. It is never canceled, has no +// values, and has no deadline. It is typically used by the main function, +// initialization, and tests, and as the top-level Context for incoming +// requests. +func Background() Context { + return background +} + +// TODO returns a non-nil, empty Context. Code should use context.TODO when +// it's unclear which Context to use or it is not yet available (because the +// surrounding function has not yet been extended to accept a Context +// parameter). TODO is recognized by static analysis tools that determine +// whether Contexts are propagated correctly in a program. +func TODO() Context { + return todo +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go new file mode 100644 index 000000000..606cf1f97 --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go @@ -0,0 +1,74 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +// Package ctxhttp provides helper functions for performing context-aware HTTP requests. +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +// Do sends an HTTP request with the provided http.Client and returns +// an HTTP response. +// +// If the client is nil, http.DefaultClient is used. +// +// The provided ctx must be non-nil. If it is canceled or times out, +// ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + resp, err := client.Do(req.WithContext(ctx)) + // If we got an error, and the context has been canceled, + // the context's error is probably more useful. + if err != nil { + select { + case <-ctx.Done(): + err = ctx.Err() + default: + } + } + return resp, err +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go new file mode 100644 index 000000000..926870cc2 --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go @@ -0,0 +1,147 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +func nop() {} + +var ( + testHookContextDoneBeforeHeaders = nop + testHookDoReturned = nop + testHookDidBodyClose = nop +) + +// Do sends an HTTP request with the provided http.Client and returns an HTTP response. +// If the client is nil, http.DefaultClient is used. +// If the context is canceled or times out, ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + + // TODO(djd): Respect any existing value of req.Cancel. + cancel := make(chan struct{}) + req.Cancel = cancel + + type responseAndError struct { + resp *http.Response + err error + } + result := make(chan responseAndError, 1) + + // Make local copies of test hooks closed over by goroutines below. + // Prevents data races in tests. + testHookDoReturned := testHookDoReturned + testHookDidBodyClose := testHookDidBodyClose + + go func() { + resp, err := client.Do(req) + testHookDoReturned() + result <- responseAndError{resp, err} + }() + + var resp *http.Response + + select { + case <-ctx.Done(): + testHookContextDoneBeforeHeaders() + close(cancel) + // Clean up after the goroutine calling client.Do: + go func() { + if r := <-result; r.resp != nil { + testHookDidBodyClose() + r.resp.Body.Close() + } + }() + return nil, ctx.Err() + case r := <-result: + var err error + resp, err = r.resp, r.err + if err != nil { + return resp, err + } + } + + c := make(chan struct{}) + go func() { + select { + case <-ctx.Done(): + close(cancel) + case <-c: + // The response's Body is closed. + } + }() + resp.Body = ¬ifyingReader{resp.Body, c} + + return resp, nil +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} + +// notifyingReader is an io.ReadCloser that closes the notify channel after +// Close is called or a Read fails on the underlying ReadCloser. +type notifyingReader struct { + io.ReadCloser + notify chan<- struct{} +} + +func (r *notifyingReader) Read(p []byte) (int, error) { + n, err := r.ReadCloser.Read(p) + if err != nil && r.notify != nil { + close(r.notify) + r.notify = nil + } + return n, err +} + +func (r *notifyingReader) Close() error { + err := r.ReadCloser.Close() + if r.notify != nil { + close(r.notify) + r.notify = nil + } + return err +} diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go new file mode 100644 index 000000000..d20f52b7d --- /dev/null +++ b/vendor/golang.org/x/net/context/go17.go @@ -0,0 +1,72 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +package context + +import ( + "context" // standard library's context, as of Go 1.7 + "time" +) + +var ( + todo = context.TODO() + background = context.Background() +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = context.Canceled + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = context.DeadlineExceeded + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + ctx, f := context.WithCancel(parent) + return ctx, CancelFunc(f) +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + ctx, f := context.WithDeadline(parent, deadline) + return ctx, CancelFunc(f) +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return context.WithValue(parent, key, val) +} diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go new file mode 100644 index 000000000..d88bd1db1 --- /dev/null +++ b/vendor/golang.org/x/net/context/go19.go @@ -0,0 +1,20 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.9 + +package context + +import "context" // standard library's context, as of Go 1.7 + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context = context.Context + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc = context.CancelFunc diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go new file mode 100644 index 000000000..0f35592df --- /dev/null +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -0,0 +1,300 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package context + +import ( + "errors" + "fmt" + "sync" + "time" +) + +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case background: + return "context.Background" + case todo: + return "context.TODO" + } + return "unknown empty Context" +} + +var ( + background = new(emptyCtx) + todo = new(emptyCtx) +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = errors.New("context canceled") + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = errors.New("context deadline exceeded") + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + c := newCancelCtx(parent) + propagateCancel(parent, c) + return c, func() { c.cancel(true, Canceled) } +} + +// newCancelCtx returns an initialized cancelCtx. +func newCancelCtx(parent Context) *cancelCtx { + return &cancelCtx{ + Context: parent, + done: make(chan struct{}), + } +} + +// propagateCancel arranges for child to be canceled when parent is. +func propagateCancel(parent Context, child canceler) { + if parent.Done() == nil { + return // parent is never canceled + } + if p, ok := parentCancelCtx(parent); ok { + p.mu.Lock() + if p.err != nil { + // parent has already been canceled + child.cancel(false, p.err) + } else { + if p.children == nil { + p.children = make(map[canceler]bool) + } + p.children[child] = true + } + p.mu.Unlock() + } else { + go func() { + select { + case <-parent.Done(): + child.cancel(false, parent.Err()) + case <-child.Done(): + } + }() + } +} + +// parentCancelCtx follows a chain of parent references until it finds a +// *cancelCtx. This function understands how each of the concrete types in this +// package represents its parent. +func parentCancelCtx(parent Context) (*cancelCtx, bool) { + for { + switch c := parent.(type) { + case *cancelCtx: + return c, true + case *timerCtx: + return c.cancelCtx, true + case *valueCtx: + parent = c.Context + default: + return nil, false + } + } +} + +// removeChild removes a context from its parent. +func removeChild(parent Context, child canceler) { + p, ok := parentCancelCtx(parent) + if !ok { + return + } + p.mu.Lock() + if p.children != nil { + delete(p.children, child) + } + p.mu.Unlock() +} + +// A canceler is a context type that can be canceled directly. The +// implementations are *cancelCtx and *timerCtx. +type canceler interface { + cancel(removeFromParent bool, err error) + Done() <-chan struct{} +} + +// A cancelCtx can be canceled. When canceled, it also cancels any children +// that implement canceler. +type cancelCtx struct { + Context + + done chan struct{} // closed by the first cancel call. + + mu sync.Mutex + children map[canceler]bool // set to nil by the first cancel call + err error // set to non-nil by the first cancel call +} + +func (c *cancelCtx) Done() <-chan struct{} { + return c.done +} + +func (c *cancelCtx) Err() error { + c.mu.Lock() + defer c.mu.Unlock() + return c.err +} + +func (c *cancelCtx) String() string { + return fmt.Sprintf("%v.WithCancel", c.Context) +} + +// cancel closes c.done, cancels each of c's children, and, if +// removeFromParent is true, removes c from its parent's children. +func (c *cancelCtx) cancel(removeFromParent bool, err error) { + if err == nil { + panic("context: internal error: missing cancel error") + } + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return // already canceled + } + c.err = err + close(c.done) + for child := range c.children { + // NOTE: acquiring the child's lock while holding parent's lock. + child.cancel(false, err) + } + c.children = nil + c.mu.Unlock() + + if removeFromParent { + removeChild(c.Context, c) + } +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { + // The current deadline is already sooner than the new one. + return WithCancel(parent) + } + c := &timerCtx{ + cancelCtx: newCancelCtx(parent), + deadline: deadline, + } + propagateCancel(parent, c) + d := deadline.Sub(time.Now()) + if d <= 0 { + c.cancel(true, DeadlineExceeded) // deadline has already passed + return c, func() { c.cancel(true, Canceled) } + } + c.mu.Lock() + defer c.mu.Unlock() + if c.err == nil { + c.timer = time.AfterFunc(d, func() { + c.cancel(true, DeadlineExceeded) + }) + } + return c, func() { c.cancel(true, Canceled) } +} + +// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to +// implement Done and Err. It implements cancel by stopping its timer then +// delegating to cancelCtx.cancel. +type timerCtx struct { + *cancelCtx + timer *time.Timer // Under cancelCtx.mu. + + deadline time.Time +} + +func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { + return c.deadline, true +} + +func (c *timerCtx) String() string { + return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) +} + +func (c *timerCtx) cancel(removeFromParent bool, err error) { + c.cancelCtx.cancel(false, err) + if removeFromParent { + // Remove this timerCtx from its parent cancelCtx's children. + removeChild(c.cancelCtx.Context, c) + } + c.mu.Lock() + if c.timer != nil { + c.timer.Stop() + c.timer = nil + } + c.mu.Unlock() +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return &valueCtx{parent, key, val} +} + +// A valueCtx carries a key-value pair. It implements Value for that key and +// delegates all other calls to the embedded Context. +type valueCtx struct { + Context + key, val interface{} +} + +func (c *valueCtx) String() string { + return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) +} + +func (c *valueCtx) Value(key interface{}) interface{} { + if c.key == key { + return c.val + } + return c.Context.Value(key) +} diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go new file mode 100644 index 000000000..b105f80be --- /dev/null +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -0,0 +1,109 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.9 + +package context + +import "time" + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + // + // WithCancel arranges for Done to be closed when cancel is called; + // WithDeadline arranges for Done to be closed when the deadline + // expires; WithTimeout arranges for Done to be closed when the timeout + // elapses. + // + // Done is provided for use in select statements: + // + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out chan<- Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } + // + // See http://blog.golang.org/pipelines for more examples of how to use + // a Done channel for cancelation. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + // + // A key identifies a specific value in a Context. Functions that wish + // to store values in Context typically allocate a key in a global + // variable then use that key as the argument to context.WithValue and + // Context.Value. A key can be any type that supports equality; + // packages should define keys as an unexported type to avoid + // collisions. + // + // Packages that define a Context key should provide type-safe accessors + // for the values stores using that key: + // + // // Package user defines a User type that's stored in Contexts. + // package user + // + // import "golang.org/x/net/context" + // + // // User is the type of value stored in the Contexts. + // type User struct {...} + // + // // key is an unexported type for keys defined in this package. + // // This prevents collisions with keys defined in other packages. + // type key int + // + // // userKey is the key for user.User values in Contexts. It is + // // unexported; clients use user.NewContext and user.FromContext + // // instead of using this key directly. + // var userKey key = 0 + // + // // NewContext returns a new Context that carries value u. + // func NewContext(ctx context.Context, u *User) context.Context { + // return context.WithValue(ctx, userKey, u) + // } + // + // // FromContext returns the User value stored in ctx, if any. + // func FromContext(ctx context.Context) (*User, bool) { + // u, ok := ctx.Value(userKey).(*User) + // return u, ok + // } + Value(key interface{}) interface{} +} + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc func() diff --git a/vendor/vendor.json b/vendor/vendor.json index 1abbbe7b7..e8c3fb6f1 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1220,6 +1220,18 @@ "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", "revisionTime": "2017-02-08T20:51:15Z" }, + { + "checksumSHA1": "GtamqiJoL7PGHsN454AoffBFMa8=", + "path": "golang.org/x/net/context", + "revision": "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec", + "revisionTime": "2018-01-12T01:53:59Z" + }, + { + "checksumSHA1": "WHc3uByvGaMcnSoI21fhzYgbOgg=", + "path": "golang.org/x/net/context/ctxhttp", + "revision": "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec", + "revisionTime": "2018-01-12T01:53:59Z" + }, { "checksumSHA1": "vqc3a+oTUGX8PmD0TS+qQ7gmN8I=", "path": "golang.org/x/net/html", From eafda52411adaabc69c6920a1fffa50ae315105f Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 22 Jan 2018 17:50:40 -0800 Subject: [PATCH 17/19] use amazon steps from master --- builder/amazon/common/step_run_source_instance.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index a5acf0e25..cc343961d 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -179,17 +179,7 @@ func (s *StepRunSourceInstance) Run(_ context.Context, state multistep.StateBag) describeInstance := &ec2.DescribeInstancesInput{ InstanceIds: []*string{aws.String(instanceId)}, } - ctx, cancel := context.WithCancel(context.Background()) - - go func() { - for { - if _, ok := state.GetOk(multistep.StateCancelled); ok { - cancel() - } - } - }() - - if err := ec2conn.WaitUntilInstanceRunningWithContext(ctx, describeInstance); err != nil { + if err := ec2conn.WaitUntilInstanceRunning(describeInstance); err != nil { err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", instanceId, err) state.Put("error", err) ui.Error(err.Error()) From 3e2895afecb12053d1d0df59cac925005a97726c Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Tue, 23 Jan 2018 09:50:06 -0800 Subject: [PATCH 18/19] comments --- helper/multistep/multistep.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helper/multistep/multistep.go b/helper/multistep/multistep.go index 7b4e0801f..39c44ed0a 100644 --- a/helper/multistep/multistep.go +++ b/helper/multistep/multistep.go @@ -22,8 +22,9 @@ const StateHalted = "halted" // Step is a single step that is part of a potentially large sequence // of other steps, responsible for performing some specific action. type Step interface { - // Run is called to perform the action. The parameter is a "state bag" - // of untyped things. Please be very careful about type-checking the + // Run is called to perform the action. The passed through context will be + // cancelled when the runner is cancelled. The second parameter is a "state + // bag" of untyped things. Please be very careful about type-checking the // items in this bag. // // The return value determines whether multi-step sequences continue From 5e444ff7ab3b5b10916000e6fce32fa80a000241 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Wed, 24 Jan 2018 17:27:08 -0800 Subject: [PATCH 19/19] update multistep documentation --- website/source/docs/extending/custom-builders.html.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/source/docs/extending/custom-builders.html.md b/website/source/docs/extending/custom-builders.html.md index 7cd31b161..3d421f35d 100644 --- a/website/source/docs/extending/custom-builders.html.md +++ b/website/source/docs/extending/custom-builders.html.md @@ -82,11 +82,11 @@ And `packer.Cache` is used to store files between multiple Packer runs, and is covered in more detail in the cache section below. Because builder runs are typically a complex set of many steps, the -[multistep](https://github.com/mitchellh/multistep) library is recommended to -bring order to the complexity. Multistep is a library which allows you to -separate your logic into multiple distinct "steps" and string them together. It -fully supports cancellation mid-step and so on. Please check it out, it is how -the built-in builders are all implemented. +[multistep](https://github.com/hashicorp/packer/blob/master/helper/multistep) +helper is recommended to bring order to the complexity. Multistep is a library +which allows you to separate your logic into multiple distinct "steps" and +string them together. It fully supports cancellation mid-step and so on. Please +check it out, it is how the built-in builders are all implemented. Finally, as a result of `Run`, an implementation of `packer.Artifact` should be returned. More details on creating a `packer.Artifact` are covered in the