From 6ef73b88beb8634dbe35903446320709f340fcd7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 17 Aug 2013 09:45:23 -0600 Subject: [PATCH] builder/amazon: fix crash case if SIGINT while waiting for instance --- builder/amazon/common/step_run_source_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/amazon/common/step_run_source_instance.go b/builder/amazon/common/step_run_source_instance.go index 8e1483da0..2fd14c98f 100644 --- a/builder/amazon/common/step_run_source_instance.go +++ b/builder/amazon/common/step_run_source_instance.go @@ -92,7 +92,6 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step StepState: state, } latestInstance, err := WaitForState(&stateChange) - s.instance = latestInstance.(*ec2.Instance) if err != nil { err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", s.instance.InstanceId, err) state["error"] = err @@ -100,6 +99,7 @@ func (s *StepRunSourceInstance) Run(state map[string]interface{}) multistep.Step return multistep.ActionHalt } + s.instance = latestInstance.(*ec2.Instance) state["instance"] = s.instance return multistep.ActionContinue