Merge pull request #535 from hashicorp/f-warn-unused-config

Warn the user when they specify a config file / folder that doesn't add any configuration options
This commit is contained in:
Chris Bednarski
2015-12-09 12:10:19 -08:00

View File

@@ -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 {