fix inheritance config on accounts command

This commit is contained in:
A.Unger
2021-11-11 12:57:18 +01:00
parent aa67106e04
commit 52d55390ab
2 changed files with 3 additions and 14 deletions
+3 -9
View File
@@ -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)
},