HewlettPackard / oneview-golang

Golang bindings for OneView api's
Apache License 2.0
27 stars 21 forks source link

fix(profiles): remove os.Exit to avoid oneview TF provider from responding #412

Open FalcoSuessgott opened 8 months ago

FalcoSuessgott commented 8 months ago

Terraform fails, because the oneview library simpy os.Exit, instead of returning any error, this prevents us from getting any error messages that causes that error. This PR removes that exit statement and returns proper errors instead:

╷
│ Error: Plugin did not respond
│ 
│   with module.bm4x_server_project.module.hpe_server["CZ224302WY"].oneview_server_profile.this,
│   on ../../modules/hpe_server/oneview.tf line 11, in resource "oneview_server_profile" "this":
│   11: resource "oneview_server_profile" "this" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.