github.phpd.cn/hashicorp/packer@v1.3.2/builder/alicloud/ecs/packer_helper.go (about) 1 package ecs 2 3 import ( 4 "fmt" 5 6 "github.com/hashicorp/packer/helper/multistep" 7 "github.com/hashicorp/packer/packer" 8 ) 9 10 func message(state multistep.StateBag, module string) { 11 _, cancelled := state.GetOk(multistep.StateCancelled) 12 _, halted := state.GetOk(multistep.StateHalted) 13 14 ui := state.Get("ui").(packer.Ui) 15 16 if cancelled || halted { 17 ui.Say(fmt.Sprintf("Deleting %s because of cancellation or error...", module)) 18 } else { 19 ui.Say(fmt.Sprintf("Cleaning up '%s'", module)) 20 } 21 22 }