From 631361f25e875a53bddedd00c4c99ca92266db59 Mon Sep 17 00:00:00 2001 From: taohe1012 <88763781+taohe1012@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:48:22 +0800 Subject: [PATCH] Enable password enhancement for manager reset resource (#260) --- redfish/provider/resource_redfish_manager_reset.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/redfish/provider/resource_redfish_manager_reset.go b/redfish/provider/resource_redfish_manager_reset.go index a4ee0fc5..c360abd5 100644 --- a/redfish/provider/resource_redfish_manager_reset.go +++ b/redfish/provider/resource_redfish_manager_reset.go @@ -156,10 +156,15 @@ func (r *managerResetResource) Create(ctx context.Context, req resource.CreateRe service = api.Service defer api.Logout() + activeServer := (plan.RedfishServer)[0] + if err := getActiveAliasRedfishServer(r.p, &activeServer); err != nil { + resp.Diagnostics.AddError("Error while getting active server", err.Error()) + return + } // Check iDRAC status checker := ServerStatusChecker{ Service: service, - Endpoint: (plan.RedfishServer)[0].Endpoint.ValueString(), + Endpoint: activeServer.Endpoint.ValueString(), Interval: defaultCheckInterval, Timeout: defaultCheckTimeout, }