mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-27 18:24:01 -04:00
Merge pull request #4846 from hashicorp/azurepanic
builder/azure: replace panics with error returns
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user