Skip to content

Commit e388d0d

Browse files
committed
chore: fix test and slight tweak to sweep error returning
1 parent a93d8c8 commit e388d0d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

provider/rediscloud_active_active_database_enable_default_user_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"strconv"
7-
"strings"
87
"testing"
98

109
"github.com/RedisLabs/rediscloud-go-api/redis"
@@ -264,7 +263,7 @@ func testCheckEnableDefaultUserInAPI(resourceName string, expectedGlobal bool, e
264263
}
265264

266265
// Get API client
267-
apiClient, err := client.GetClient()
266+
apiClient, err := client.NewClient()
268267
if err != nil {
269268
return fmt.Errorf("failed to get API client: %v", err)
270269
}

provider/sweeper_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ func testSweepAcl(region string) error {
329329
continue
330330
}
331331

332-
if client.Users.Delete(ctx, redis.IntValue(user.ID)) != nil {
333-
return err
332+
if delErr := client.Users.Delete(ctx, redis.IntValue(user.ID)); delErr != nil {
333+
return delErr
334334
}
335335
}
336336

@@ -344,8 +344,8 @@ func testSweepAcl(region string) error {
344344
continue
345345
}
346346

347-
if client.Roles.Delete(ctx, redis.IntValue(role.ID)) != nil {
348-
return err
347+
if delErr := client.Roles.Delete(ctx, redis.IntValue(role.ID)); delErr != nil {
348+
return delErr
349349
}
350350
}
351351

0 commit comments

Comments
 (0)