Merge pull request #4846 from hashicorp/azurepanic

builder/azure: replace panics with error returns
This commit is contained in:
Matthew Hooker 2017-04-27 11:07:27 -07:00 committed by GitHub
commit 122ab87f92
1 changed files with 2 additions and 2 deletions

View File

@ -248,11 +248,11 @@ func setSshValues(c *Config) error {
if c.Comm.SSHPrivateKey != "" {
privateKeyBytes, err := ioutil.ReadFile(c.Comm.SSHPrivateKey)
if err != nil {
panic(err)
return err
}
signer, err := ssh.ParsePrivateKey(privateKeyBytes)
if err != nil {
panic(err)
return err
}
publicKey := signer.PublicKey()