mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-25 21:48:28 -05:00
fix inheritance config on accounts command
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user