From 84e0d70323594a59365099c208e16f5780936807 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 11 Dec 2020 08:33:02 +0100 Subject: [PATCH] get rid of unused AccountsDataPath --- accounts/pkg/config/config.go | 7 +++---- accounts/pkg/flagset/flagset.go | 7 ------- accounts/pkg/proto/v0/accounts.pb.micro_test.go | 1 - accounts/pkg/service/v0/accounts_permission_test.go | 1 - accounts/pkg/service/v0/groups.go | 4 +--- 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/accounts/pkg/config/config.go b/accounts/pkg/config/config.go index 950aa615932..5ce47e94ff5 100644 --- a/accounts/pkg/config/config.go +++ b/accounts/pkg/config/config.go @@ -40,10 +40,9 @@ type GRPC struct { // Server configures a server. type Server struct { - Version string - Name string - AccountsDataPath string - HashDifficulty int + Version string + Name string + HashDifficulty int } // Asset defines the available asset configuration. diff --git a/accounts/pkg/flagset/flagset.go b/accounts/pkg/flagset/flagset.go index d423e3b8f55..8ff36871942 100644 --- a/accounts/pkg/flagset/flagset.go +++ b/accounts/pkg/flagset/flagset.go @@ -119,13 +119,6 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"ACCOUNTS_NAME"}, Destination: &cfg.Server.Name, }, - &cli.StringFlag{ - Name: "accounts-data-path", - Value: "/var/tmp/ocis-accounts", - Usage: "accounts folder", - EnvVars: []string{"ACCOUNTS_DATA_PATH"}, - Destination: &cfg.Server.AccountsDataPath, - }, &cli.IntFlag{ Name: "accounts-hash-difficulty", Value: 11, diff --git a/accounts/pkg/proto/v0/accounts.pb.micro_test.go b/accounts/pkg/proto/v0/accounts.pb.micro_test.go index 2ddc73e479e..03d8731c6ae 100644 --- a/accounts/pkg/proto/v0/accounts.pb.micro_test.go +++ b/accounts/pkg/proto/v0/accounts.pb.micro_test.go @@ -78,7 +78,6 @@ func init() { ) cfg := config.New() - cfg.Server.AccountsDataPath = dataPath cfg.Repo.Disk.Path = dataPath var hdlr *svc.Service var err error diff --git a/accounts/pkg/service/v0/accounts_permission_test.go b/accounts/pkg/service/v0/accounts_permission_test.go index 10e05bcc5cc..22d1a1aa2fa 100644 --- a/accounts/pkg/service/v0/accounts_permission_test.go +++ b/accounts/pkg/service/v0/accounts_permission_test.go @@ -33,7 +33,6 @@ var ( func init() { cfg := config.New() cfg.Server.Name = "accounts" - cfg.Server.AccountsDataPath = dataPath cfg.Repo.Disk.Path = dataPath logger := olog.NewLogger(olog.Color(true), olog.Pretty(true)) roleServiceMock = buildRoleServiceMock() diff --git a/accounts/pkg/service/v0/groups.go b/accounts/pkg/service/v0/groups.go index d8e3987bf7e..662411ee246 100644 --- a/accounts/pkg/service/v0/groups.go +++ b/accounts/pkg/service/v0/groups.go @@ -3,7 +3,6 @@ package service import ( "context" "path" - "path/filepath" "strconv" "github.com/gofrs/uuid" @@ -182,7 +181,6 @@ func (s Service) DeleteGroup(c context.Context, in *proto.DeleteGroupRequest, ou if id, err = cleanupID(in.Id); err != nil { return merrors.InternalServerError(s.id, "could not clean up group id: %v", err.Error()) } - path := filepath.Join(s.Config.Server.AccountsDataPath, "groups", id) g := &proto.Group{} if err = s.repo.LoadGroup(c, id, g); err != nil { @@ -212,7 +210,7 @@ func (s Service) DeleteGroup(c context.Context, in *proto.DeleteGroupRequest, ou } if err = s.index.Delete(g); err != nil { - s.log.Error().Err(err).Str("id", id).Str("path", path).Msg("could not remove group from index") + s.log.Error().Err(err).Str("id", id).Msg("could not remove group from index") return merrors.InternalServerError(s.id, "could not remove group from index: %v", err.Error()) }