mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-17 02:11:03 +02:00
cmd: no context + logging for config parsing
This commit is contained in:
@ -3,7 +3,6 @@ package cmd
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"github.com/pkg/errors"
|
||||
@ -28,9 +27,7 @@ type ConfigParsingContext struct {
|
||||
Global *Global
|
||||
}
|
||||
|
||||
func ParseConfig(ctx context.Context, path string) (config *Config, err error) {
|
||||
|
||||
log := ctx.Value(contextKeyLog).(Logger)
|
||||
func ParseConfig(path string) (config *Config, err error) {
|
||||
|
||||
if path == "" {
|
||||
// Try default locations
|
||||
@ -40,7 +37,7 @@ func ParseConfig(ctx context.Context, path string) (config *Config, err error) {
|
||||
continue
|
||||
}
|
||||
if !stat.Mode().IsRegular() {
|
||||
log.Printf("warning: file at default location is not a regular file: %s", l)
|
||||
err = errors.Errorf("file at default location is not a regular file: %s", l)
|
||||
continue
|
||||
}
|
||||
path = l
|
||||
|
Reference in New Issue
Block a user