builder/amazon: fix crash case if SIGINT while waiting for instance
This commit is contained in:
parent
775555944e
commit
6ef73b88be
|
@ -92,7 +92,6 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
|
||||||
StepState: state,
|
StepState: state,
|
||||||
}
|
}
|
||||||
latestInstance, err := WaitForState(&stateChange)
|
latestInstance, err := WaitForState(&stateChange)
|
||||||
s.instance = latestInstance.(*ec2.Instance)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", s.instance.InstanceId, err)
|
err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", s.instance.InstanceId, err)
|
||||||
state["error"] = err
|
state["error"] = err
|
||||||
|
@ -100,6 +99,7 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.instance = latestInstance.(*ec2.Instance)
|
||||||
state["instance"] = s.instance
|
state["instance"] = s.instance
|
||||||
|
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
|
|
Loading…
Reference in New Issue