Skip to content

Commit

Permalink
Merge pull request #1061 from owncloud/remove_AccountsDataPath
Browse files Browse the repository at this point in the history
get rid of unused AccountsDataPath
  • Loading branch information
wkloucek authored Dec 11, 2020
2 parents 64a39ff + 7f986a3 commit e8d9b43
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 19 deletions.
7 changes: 3 additions & 4 deletions accounts/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions accounts/pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion accounts/pkg/proto/v0/accounts.pb.micro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion accounts/pkg/service/v0/accounts_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions accounts/pkg/service/v0/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package service
import (
"context"
"path"
"path/filepath"
"strconv"

"github.com/gofrs/uuid"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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())
}

Expand Down
4 changes: 1 addition & 3 deletions ocs/pkg/server/http/svc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,7 @@ func init() {
)

c := &accountsCfg.Config{
Server: accountsCfg.Server{
AccountsDataPath: dataPath,
},
Server: accountsCfg.Server{},
Repo: accountsCfg.Repo{
Disk: accountsCfg.Disk{
Path: dataPath,
Expand Down

0 comments on commit e8d9b43

Please sign in to comment.