From ff899a7d46652ecae99c1f833fc0050091274eec Mon Sep 17 00:00:00 2001 From: Jose Luis Pedrosa Date: Thu, 21 Sep 2023 10:56:36 +0100 Subject: [PATCH] Clean custom serach filter with builtin --- routeros/resource_interface_ethernet.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routeros/resource_interface_ethernet.go b/routeros/resource_interface_ethernet.go index d9910c6e..3e726e9d 100644 --- a/routeros/resource_interface_ethernet.go +++ b/routeros/resource_interface_ethernet.go @@ -318,8 +318,8 @@ func NoOpDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag func findInterfaceByDefaultName(s map[string]*schema.Schema, d *schema.ResourceData, c Client) (MikrotikItem, error) { metadata := GetMetadata(s) - filter := fmt.Sprintf("default-name=%s", d.Get("factory_name")) - items, err := ReadItemsFiltered([]string{filter}, metadata.Path, c) + filter := buildReadFilter(map[string]interface{}{"default-name": d.Get("factory_name")}) + items, err := ReadItemsFiltered(filter, metadata.Path, c) if err != nil { return nil, err }