From 54614b1c6aef0531fff9e9f38dbcd5735c5240e8 Mon Sep 17 00:00:00 2001 From: Maksym Nazarenko Date: Sun, 22 Oct 2023 00:15:08 +0300 Subject: [PATCH] fix more resources --- mikrotik/resource_firewall_filter.go | 3 ++- mikrotik/resource_interface_list_member.go | 3 ++- mikrotik/resource_pool.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mikrotik/resource_firewall_filter.go b/mikrotik/resource_firewall_filter.go index c8c1c044..c7095403 100644 --- a/mikrotik/resource_firewall_filter.go +++ b/mikrotik/resource_firewall_filter.go @@ -5,6 +5,7 @@ import ( "github.com/ddelnano/terraform-provider-mikrotik/client" "github.com/ddelnano/terraform-provider-mikrotik/mikrotik/internal/types/defaultaware" + "github.com/ddelnano/terraform-provider-mikrotik/mikrotik/internal/utils" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -141,7 +142,7 @@ func (r *firewallFilterRule) Delete(ctx context.Context, req resource.DeleteRequ func (r *firewallFilterRule) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { // Retrieve import ID and save to id attribute - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + utils.ImportUppercaseWrapper(resource.ImportStatePassthroughID)(ctx, path.Root("id"), req, resp) } type firewallFilterRuleModel struct { diff --git a/mikrotik/resource_interface_list_member.go b/mikrotik/resource_interface_list_member.go index 5ca50a47..dda1ed0b 100644 --- a/mikrotik/resource_interface_list_member.go +++ b/mikrotik/resource_interface_list_member.go @@ -4,6 +4,7 @@ import ( "context" "github.com/ddelnano/terraform-provider-mikrotik/client" + "github.com/ddelnano/terraform-provider-mikrotik/mikrotik/internal/utils" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -96,7 +97,7 @@ func (r *interfaceListMember) Delete(ctx context.Context, req resource.DeleteReq func (r *interfaceListMember) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { // Retrieve import ID and save to id attribute - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + utils.ImportUppercaseWrapper(resource.ImportStatePassthroughID)(ctx, path.Root("id"), req, resp) } type interfaceListMemberModel struct { diff --git a/mikrotik/resource_pool.go b/mikrotik/resource_pool.go index f563c3f9..55690743 100644 --- a/mikrotik/resource_pool.go +++ b/mikrotik/resource_pool.go @@ -148,7 +148,7 @@ func (r *pool) Delete(ctx context.Context, req resource.DeleteRequest, resp *res func (r *pool) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { // Retrieve import ID and save to id attribute - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + utils.ImportUppercaseWrapper(resource.ImportStatePassthroughID)(ctx, path.Root("id"), req, resp) } type poolModel struct {