From 93a461029e5b91260650f2bf9c41a5557664be86 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Wed, 2 Dec 2015 23:22:18 -0800 Subject: [PATCH] Warn the user when they specify a config file / folder that doesn't add any configuration options --- command/agent/command.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index ecae14d81..91be75f4c 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -7,6 +7,7 @@ import ( "os" "os/signal" "path/filepath" + "reflect" "sort" "strconv" "strings" @@ -135,6 +136,12 @@ func (c *Command) readConfig() *Config { return nil } + // The user asked us to load some config here but we didn't find any, + // so we'll complain but continue. + if current == nil || reflect.DeepEqual(current, &Config{}) { + c.Ui.Warn(fmt.Sprintf("No configuration loaded from %s", path)) + } + if config == nil { config = current } else {