github.com/phobos182/packer@v0.2.3-0.20130819023704-c84d2aeffc68/builder/amazon/chroot/step_early_unflock.go (about) 1 package chroot 2 3 import ( 4 "fmt" 5 "github.com/mitchellh/multistep" 6 "github.com/mitchellh/packer/packer" 7 "log" 8 ) 9 10 // StepEarlyUnflock unlocks the flock. 11 type StepEarlyUnflock struct{} 12 13 func (s *StepEarlyUnflock) Run(state map[string]interface{}) multistep.StepAction { 14 cleanup := state["flock_cleanup"].(Cleanup) 15 ui := state["ui"].(packer.Ui) 16 17 log.Println("Unlocking file lock...") 18 if err := cleanup.CleanupFunc(state); err != nil { 19 err := fmt.Errorf("Error unlocking file lock: %s", err) 20 state["error"] = err 21 ui.Error(err.Error()) 22 return multistep.ActionHalt 23 } 24 25 return multistep.ActionContinue 26 } 27 28 func (s *StepEarlyUnflock) Cleanup(state map[string]interface{}) {}