github.com/mmcquillan/packer@v1.1.1-0.20171009221028-c85cf0483a5d/builder/triton/step_wait_for_stop_to_not_fail.go (about)

     1  package triton
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/hashicorp/packer/packer"
     7  	"github.com/mitchellh/multistep"
     8  )
     9  
    10  // StepWaitForStopNotToFail waits for 10 seconds before returning with continue
    11  // in order to prevent an observed issue where machines stopped immediately after
    12  // they are started never actually stop.
    13  type StepWaitForStopNotToFail struct{}
    14  
    15  func (s *StepWaitForStopNotToFail) Run(state multistep.StateBag) multistep.StepAction {
    16  	ui := state.Get("ui").(packer.Ui)
    17  	ui.Say("Waiting 10 seconds to avoid potential SDC bug...")
    18  	time.Sleep(10 * time.Second)
    19  	return multistep.ActionContinue
    20  }
    21  
    22  func (s *StepWaitForStopNotToFail) Cleanup(state multistep.StateBag) {
    23  	// No clean up required...
    24  }