2017-03-03 16:56:17 +08:00
|
|
|
package ecs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2017-06-01 17:14:51 -07:00
|
|
|
|
2017-04-17 21:04:52 +08:00
|
|
|
"github.com/hashicorp/packer/packer"
|
2017-03-03 16:56:17 +08:00
|
|
|
"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 {
|
2017-06-01 19:33:12 -07:00
|
|
|
ui.Say(fmt.Sprintf("Deleting %s because of cancellation or error...", module))
|
2017-03-03 16:56:17 +08:00
|
|
|
} else {
|
2017-06-01 19:33:12 -07:00
|
|
|
ui.Say(fmt.Sprintf("Cleaning up '%s'", module))
|
2017-03-03 16:56:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|