Skip to content

Commit

Permalink
Merge pull request #535 from hashicorp/f-warn-unused-config
Browse files Browse the repository at this point in the history
Warn the user when they specify a config file / folder that doesn't add any configuration options
  • Loading branch information
cbednarski committed Dec 9, 2015
2 parents e4989bf + 93a4610 commit e864e5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/signal"
"path/filepath"
"reflect"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e864e5d

Please sign in to comment.