Commit 7d1db44c authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazon: clean up UI output for spot instances a bit

parent 2e5f3da5
......@@ -93,6 +93,10 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
}
instanceId = []string{runResp.Instances[0].InstanceId}
} else {
ui.Message(fmt.Sprintf(
"Requesting spot instance '%s' for: %s",
s.InstanceType, s.SpotPrice))
runOpts := &ec2.RequestSpotInstances{
SpotPrice: s.SpotPrice,
KeyName: keyName,
......@@ -113,9 +117,11 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
ui.Error(err.Error())
return multistep.ActionHalt
}
s.spotRequest = &runSpotResp.SpotRequestResults[0]
spotRequestId := s.spotRequest.SpotRequestId
ui.Say(fmt.Sprintf("Waiting for spot request (%s) to become ready...", spotRequestId))
ui.Message(fmt.Sprintf("Waiting for spot request (%s) to become active...", spotRequestId))
stateChange := StateChangeConf{
Pending: []string{"open"},
Target: "active",
......
......@@ -19,7 +19,6 @@ func (s *stepStopInstance) Run(state multistep.StateBag) multistep.StepAction {
// Skip when it is a spot instance
if s.SpotPrice != "" {
ui.Say(fmt.Sprintf("This is a spot instance, no need to stop for the AMI"))
return multistep.ActionContinue
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment