addded webdav to the new inheritance strategy

This commit is contained in:
A.Unger
2021-11-11 15:59:13 +01:00
parent 4cecd9b5d2
commit 9c2150422d
5 changed files with 38 additions and 52 deletions
+3 -8
View File
@@ -5,7 +5,6 @@ package command
import (
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/owncloud/ocis/webdav/pkg/command"
"github.com/urfave/cli/v2"
@@ -13,7 +12,6 @@ import (
// WebDAVCommand is the entrypoint for the webdav command.
func WebDAVCommand(cfg *config.Config) *cli.Command {
var globalLog shared.Log
return &cli.Command{
Name: "webdav",
@@ -27,16 +25,13 @@ func WebDAVCommand(cfg *config.Config) *cli.Command {
return err
}
globalLog = cfg.Log
if cfg.Commons != nil {
cfg.WebDAV.Commons = cfg.Commons
}
return nil
},
Action: func(c *cli.Context) error {
// if webdav logging is empty in ocis.yaml
if (cfg.WebDAV.Log == shared.Log{}) && (globalLog != shared.Log{}) {
// we can safely inherit the global logging values.
cfg.WebDAV.Log = globalLog
}
origCmd := command.Server(cfg.WebDAV)
return handleOriginalAction(c, origCmd)
},