From 031c25154f0050ba1616196df64afbccb01a76f2 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Tue, 12 Aug 2014 08:29:00 -0700 Subject: [PATCH] openstack builder error out when gets blank keypair --- builder/openstack/step_key_pair.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builder/openstack/step_key_pair.go b/builder/openstack/step_key_pair.go index 8f729b40f..40e93df30 100644 --- a/builder/openstack/step_key_pair.go +++ b/builder/openstack/step_key_pair.go @@ -29,6 +29,10 @@ func (s *StepKeyPair) Run(state multistep.StateBag) multistep.StepAction { state.Put("error", fmt.Errorf("Error creating temporary keypair: %s", err)) return multistep.ActionHalt } + if keyResp.PrivateKey == "" { + state.Put("error", fmt.Errorf("The temporary keypair returned was blank")) + return multistep.ActionHalt + } // If we're in debug mode, output the private key to the working // directory.