packer-cn/builder/alicloud/ecs/packer_helper.go

22 lines
476 B
Go
Raw Normal View History

package ecs
import (
"fmt"
"github.com/hashicorp/packer/packer"
"github.com/mitchellh/multistep"
)
func message(state multistep.StateBag, module string) {
_, cancelled := state.GetOk(multistep.StateCancelled)
_, halted := state.GetOk(multistep.StateHalted)
ui := state.Get("ui").(packer.Ui)
if cancelled || halted {
ui.Say(fmt.Sprintf("Delete the %s because cancelation or error...", module))
} else {
ui.Say(fmt.Sprintf("Clean the created %s", module))
}
}