Merge pull request #4846 from hashicorp/azurepanic
builder/azure: replace panics with error returns
This commit is contained in:
commit
122ab87f92
|
@ -248,11 +248,11 @@ func setSshValues(c *Config) error {
|
||||||
if c.Comm.SSHPrivateKey != "" {
|
if c.Comm.SSHPrivateKey != "" {
|
||||||
privateKeyBytes, err := ioutil.ReadFile(c.Comm.SSHPrivateKey)
|
privateKeyBytes, err := ioutil.ReadFile(c.Comm.SSHPrivateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return err
|
||||||
}
|
}
|
||||||
signer, err := ssh.ParsePrivateKey(privateKeyBytes)
|
signer, err := ssh.ParsePrivateKey(privateKeyBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
publicKey := signer.PublicKey()
|
publicKey := signer.PublicKey()
|
||||||
|
|
Loading…
Reference in New Issue