From cfa2d85eb22e040e7e24e3e615ed08a70beacb4d Mon Sep 17 00:00:00 2001 From: Kian Parvin Date: Tue, 5 Sep 2023 09:17:54 +0200 Subject: [PATCH] Fixes --- internal/jimm/controller.go | 2 +- internal/jimm/controller_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/jimm/controller.go b/internal/jimm/controller.go index b4ed96b43..0caad17c6 100644 --- a/internal/jimm/controller.go +++ b/internal/jimm/controller.go @@ -522,7 +522,7 @@ func (j *JIMM) ImportModel(ctx context.Context, u *dbmodel.User, controllerName errors.E(op, err) } if len(allCredentials) == 0 { - return errors.E(op, errors.CodeNotFound, fmt.Sprintf("Failed to find cloud credential for user %s on cloud %s", u.Username, cloudTag.Id())) + return errors.E(op, errors.CodeNotFound, fmt.Sprintf("Failed to find cloud credential for user %s on cloud %s", ownerUser.Username, cloudTag.Id())) } cloudCredential := allCredentials[0] diff --git a/internal/jimm/controller_test.go b/internal/jimm/controller_test.go index 2c65ac825..4a11d4e42 100644 --- a/internal/jimm/controller_test.go +++ b/internal/jimm/controller_test.go @@ -823,7 +823,7 @@ func TestImportModel(t *testing.T) { Valid: true, }, Owner: dbmodel.User{ - Username: "alice@external", // Owner will switch to the user doing the import + Username: "alice@external", DisplayName: "Alice", ControllerAccess: "superuser", },