openstack builder error out when gets blank keypair

This commit is contained in:
Marc Abramowitz 2014-08-12 08:29:00 -07:00
parent a5bc5beccb
commit 031c25154f
1 changed files with 4 additions and 0 deletions

View File

@ -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.