From 52d55390abd28d11c223cd54bbd79714be9a6e9c Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Thu, 11 Nov 2021 12:57:18 +0100 Subject: [PATCH] fix inheritance config on accounts command --- ocis/pkg/command/accounts.go | 12 +++--------- store/pkg/command/root.go | 5 ----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/ocis/pkg/command/accounts.go b/ocis/pkg/command/accounts.go index b335b5496..1cacd70d0 100644 --- a/ocis/pkg/command/accounts.go +++ b/ocis/pkg/command/accounts.go @@ -6,15 +6,12 @@ package command import ( "github.com/owncloud/ocis/accounts/pkg/command" "github.com/owncloud/ocis/ocis-pkg/config" - "github.com/owncloud/ocis/ocis-pkg/shared" "github.com/owncloud/ocis/ocis/pkg/register" "github.com/urfave/cli/v2" ) // AccountsCommand is the entrypoint for the accounts command. func AccountsCommand(cfg *config.Config) *cli.Command { - var globalLog shared.Log - return &cli.Command{ Name: "accounts", Usage: "Start accounts server", @@ -32,16 +29,13 @@ func AccountsCommand(cfg *config.Config) *cli.Command { return err } - globalLog = cfg.Log + if cfg.Commons != nil { + cfg.Accounts.Commons = cfg.Commons + } return nil }, Action: func(c *cli.Context) error { - // if accounts logging is empty in ocis.yaml - if (cfg.Accounts.Log == shared.Log{}) && (globalLog != shared.Log{}) { - // we can safely inherit the global logging values. - cfg.Accounts.Log = globalLog - } origCmd := command.Server(cfg.Accounts) return handleOriginalAction(c, origCmd) }, diff --git a/store/pkg/command/root.go b/store/pkg/command/root.go index 6b6ef33c1..49584e63c 100644 --- a/store/pkg/command/root.go +++ b/store/pkg/command/root.go @@ -4,8 +4,6 @@ import ( "context" "os" - "github.com/owncloud/ocis/ocis-pkg/shared" - ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/version" @@ -86,9 +84,6 @@ type SutureService struct { // NewSutureService creates a new store.SutureService func NewSutureService(cfg *ociscfg.Config) suture.Service { - if (cfg.Accounts.Log == shared.Log{}) { - cfg.Accounts.Log = cfg.Log - } return SutureService{ cfg: cfg.Store, }